kernel_optimize_test/arch/s390/include/asm
Halil Pasic 1db337b10d KVM: s390: index kvm->arch.idle_mask by vcpu_idx
commit a3e03bc1368c1bc16e19b001fc96dc7430573cc8 upstream.

While in practice vcpu->vcpu_idx ==  vcpu->vcp_id is often true, it may
not always be, and we must not rely on this. Reason is that KVM decides
the vcpu_idx, userspace decides the vcpu_id, thus the two might not
match.

Currently kvm->arch.idle_mask is indexed by vcpu_id, which implies
that code like
for_each_set_bit(vcpu_id, kvm->arch.idle_mask, online_vcpus) {
                vcpu = kvm_get_vcpu(kvm, vcpu_id);
		do_stuff(vcpu);
}
is not legit. Reason is that kvm_get_vcpu expects an vcpu_idx, not an
vcpu_id.  The trouble is, we do actually use kvm->arch.idle_mask like
this. To fix this problem we have two options. Either use
kvm_get_vcpu_by_id(vcpu_id), which would loop to find the right vcpu_id,
or switch to indexing via vcpu_idx. The latter is preferable for obvious
reasons.

Let us make switch from indexing kvm->arch.idle_mask by vcpu_id to
indexing it by vcpu_idx.  To keep gisa_int.kicked_mask indexed by the
same index as idle_mask lets make the same change for it as well.

Fixes: 1ee0bc559d ("KVM: s390: get rid of local_int array")
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Christian Bornträger <borntraeger@de.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: <stable@vger.kernel.org> # 3.15+
Link: https://lore.kernel.org/r/20210827125429.1912577-1-pasic@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-15 09:50:47 +02:00
..
fpu
trace
vdso s390/vdso: fix tod_steering_delta type 2021-04-07 15:00:10 +02:00
airq.h
alternative-asm.h
alternative.h s390/alternatives: make use of asm_inline 2019-10-31 17:20:51 +01:00
ap.h
appldata.h
archrandom.h s390x: Mark archrandom.h functions __must_check 2020-01-25 12:18:51 -05:00
asm-const.h s390/kernel: unify EX_TABLE* implementations 2020-07-20 10:55:45 +02:00
asm-prototypes.h
atomic_ops.h s390/atomic,bitops: mark function(s) __always_inline 2019-10-04 16:37:33 +02:00
atomic.h s390/atomic: circumvent gcc 10 build regression 2020-08-11 18:16:08 +02:00
barrier.h
bitops.h kasan: support instrumented bitops combined with generic bitops 2019-11-07 13:15:39 +11:00
boot_data.h
bug.h printk: Make linux/printk.h self-contained 2020-07-27 17:46:24 +09:00
bugs.h
cache.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
ccwdev.h s390/cio: Helper functions to read CSSID, IID, and CHID 2020-09-15 13:21:46 -07:00
ccwgroup.h s390/net: remove pm ops from ccwgroup drivers 2020-05-19 12:48:39 -07:00
checksum.h s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
chpid.h
chsc.h s390/cio: Add new Operation Code OC3 to PNSO 2020-09-15 13:21:46 -07:00
cio.h s390/cio: remove unused channel_subsystem_reinit 2020-09-30 12:09:54 +02:00
clocksource.h s390: convert to GENERIC_VDSO 2020-08-26 18:47:21 +02:00
clp.h s390/pci: Implement ioremap_wc/prot() with MIO 2020-09-14 10:30:07 +02:00
cmb.h
cmpxchg.h
compat.h compat: lift compat_s64 and compat_u64 to <asm-generic/compat.h> 2020-09-17 13:00:46 -04:00
cpacf.h s390: mark __cpacf_query() as __always_inline 2019-10-04 16:37:33 +02:00
cpcmd.h
cpu_mcf.h
cpu_mf-insn.h
cpu_mf.h s390/cpum_sf: Replace function name in debug statements 2019-11-30 10:52:46 +01:00
cpu.h
cpufeature.h
cputime.h
crw.h
css_chars.h s390/cio: Add new Operation Code OC3 to PNSO 2020-09-15 13:21:46 -07:00
ctl_reg.h s390/early: move control registers setup in C code 2019-11-20 12:58:12 +01:00
current.h
debug.h s390/debug: debug feature version 3 2020-08-11 18:16:43 +02:00
delay.h
diag.h s390/setup: diag 318: refactor struct 2020-06-23 09:16:48 +02:00
dis.h
dma.h
dwarf.h
eadm.h
ebcdic.h
elf.h
exec.h
extable.h s390/kernel: expand exception table logic to allow new handling options 2020-07-20 10:55:50 +02:00
extmem.h
facility.h
fcx.h
ftrace.h s390/ftrace: fix ftrace_update_ftrace_func implementation 2021-07-28 14:35:42 +02:00
futex.h [parisc, s390, sparc64] no need for access_ok() in futex handling 2020-03-27 23:58:52 -04:00
gmap.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
hardirq.h
hugetlb.h mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
hw_irq.h s390/irq: make init_ext_interrupts static 2020-03-11 14:18:44 +01:00
idals.h
idle.h
io.h s390/pci: Implement ioremap_wc/prot() with MIO 2020-09-14 10:30:07 +02:00
ipl.h s390/nvme: support firmware-assisted dump to NVMe disks 2020-10-02 14:40:48 +02:00
irq.h
irqflags.h
isc.h
itcw.h
jump_label.h s390/jump_label: use "i" constraint for clang 2020-01-22 13:05:35 +01:00
kasan.h s390/kasan: support protvirt with 4-level paging 2020-09-16 14:08:48 +02:00
Kbuild local64.h: make <asm/local64.h> mandatory 2021-01-12 20:18:16 +01:00
kdebug.h
kexec.h
kprobes.h s390: support KPROBES_ON_FTRACE 2020-01-30 13:07:55 +01:00
kvm_host.h KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2021-09-15 09:50:47 +02:00
kvm_para.h
linkage.h s390/kernel: expand exception table logic to allow new handling options 2020-07-20 10:55:50 +02:00
livepatch.h
lowcore.h s390: prevent leaking kernel address in BEAR 2020-03-10 15:16:25 +01:00
mem_detect.h
mem_encrypt.h
mmu_context.h s390 updates for the 5.7 merge window 2020-04-04 09:45:50 -07:00
mmu.h s390 updates for the 5.7 merge window 2020-04-04 09:45:50 -07:00
mmzone.h
module.h
nmi.h s390: remove critical section cleanup from entry.S 2020-05-28 12:21:54 +02:00
nospec-branch.h
nospec-insn.h
numa.h s390/mm: remove fake numa support 2020-02-27 16:02:21 +01:00
os_info.h
page-states.h
page.h mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS 2020-04-10 15:36:21 -07:00
pci_clp.h s390/pci: Implement ioremap_wc/prot() with MIO 2020-09-14 10:30:07 +02:00
pci_debug.h
pci_dma.h s390/pci: remove unused functions 2020-06-29 16:32:09 +02:00
pci_insn.h
pci_io.h s390/pci: Fix s390_mmio_read/write with MIO 2020-05-14 23:21:37 +02:00
pci.h s390/pci: fix leak of PCI device structure 2021-03-25 09:04:05 +01:00
percpu.h s390: don't trace preemption in percpu macros 2020-08-26 18:07:04 +02:00
perf_event.h s390: implement perf_arch_fetch_caller_regs 2019-11-30 10:52:44 +01:00
pgalloc.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
pgtable.h s390: enable HAVE_IOREMAP_PROT 2021-07-14 16:56:42 +02:00
pkey.h
pnet.h
preempt.h s390: preempt: Fix preempt_count initialization 2021-07-14 16:56:54 +02:00
processor.h s390/processor: always inline stap() and __load_psw_mask() 2021-07-20 16:05:44 +02:00
ptdump.h s390: add ARCH_HAS_DEBUG_WX support 2020-09-14 11:38:35 +02:00
ptrace.h s390: enable HAVE_FUNCTION_ERROR_INJECTION 2020-07-27 10:33:28 +02:00
purgatory.h
qdio.h s390/qdio: always use dev_name() for device name in QIB 2020-09-14 10:30:07 +02:00
runtime_instr.h
schid.h
sclp.h s390/sclp: Add support for SCLP AP adapter config/deconfig 2020-10-07 21:50:00 +02:00
scsw.h
seccomp.h
sections.h s390: correct __bootdata / __bootdata_preserved macros 2020-10-26 14:18:01 +01:00
serial.h
set_memory.h s390/mm,ptdump: hold cpa mutex while walking for kernel page table dump 2020-09-14 11:38:34 +02:00
setup.h s390: remove orphaned extern variables declarations 2020-10-02 14:40:48 +02:00
shmparam.h
signal.h
sigp.h
smp.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
sparsemem.h
spinlock_types.h
spinlock.h s390/alternatives: make use of asm_inline 2019-10-31 17:20:51 +01:00
stacktrace.h s390: introduce proper type handling call_on_stack() macro 2021-07-25 14:36:17 +02:00
stp.h s390/stp: add support for leap seconds 2020-09-26 15:51:21 +02:00
string.h
switch_to.h
syscall_wrapper.h s390: enable HAVE_FUNCTION_ERROR_INJECTION 2020-07-27 10:33:28 +02:00
syscall.h s390: fix syscall_get_error for compat processes 2020-06-17 23:05:05 +02:00
sysinfo.h
termios.h
thread_info.h s390: Break cyclic percpu include 2020-07-10 12:00:02 +02:00
timex.h s390/time: remove unused function 2020-06-29 16:32:14 +02:00
tlb.h mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
tlbflush.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
topology.h s390/numa: set node distance to LOCAL_DISTANCE 2020-08-11 18:16:35 +02:00
uaccess.h s390/uaccess: fix indentation 2020-10-09 23:45:30 +02:00
unistd.h
unwind.h s390/unwind: start unwinding from reliable state 2019-11-30 10:52:48 +01:00
uprobes.h
user.h
uv.h s390: mm: Fix secure storage access exception handling 2021-07-14 16:55:43 +02:00
vdso.h s390/vdso: remove orphaned declarations 2020-09-30 12:09:54 +02:00
vga.h
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
vmlinux.lds.h
vtime.h
vtimer.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
vx-insn.h
xor.h