linux_dsm_epyc7002/arch
Halil Pasic 9f2a82caea 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>
2024-07-05 19:13:47 +02:00
..
alpha alpha: Send stop IPI to send to online CPUs 2024-07-05 18:52:32 +02:00
arc ARC: Fix CONFIG_STACKDEPOT 2024-07-05 18:56:15 +02:00
arm ARM: dts: meson8b: ec100: Fix the pwm regulator supply properties 2024-07-05 19:11:19 +02:00
arm64 arm64: dts: marvell: armada-37xx: Extend PCIe MEM space 2024-07-05 19:12:04 +02:00
c6x arch-cleanup-2020-10-22 2020-10-23 10:06:38 -07:00
csky csky: syscache: Fixup duplicate cache flush 2021-07-14 16:56:52 +02:00
h8300 h8300: fix PREEMPTION build, TI_PRE_COUNT undefined 2021-02-17 11:02:28 +01:00
hexagon hexagon: use common DISCARDS macro 2021-07-20 16:05:53 +02:00
ia64 mm/page_alloc: fix memory map initialization for descending nodes 2021-07-25 14:36:18 +02:00
m68k m68k: Fix invalid RMW_INSNS on CPUs that lack CAS 2024-07-05 19:10:07 +02:00
microblaze init: add dsm gpl source 2024-07-05 18:00:04 +02:00
mips MIPS: Malta: Do not byte-swap accesses to the CBUS UART 2024-07-05 18:52:29 +02:00
nds32 nds32: fix up stack guard gap 2021-07-28 14:35:46 +02:00
nios2 nios2: fixed broken sys_clone syscall 2021-03-04 11:38:16 +01:00
openrisc sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
parisc Revert "parisc: Add assembly implementations for memset, strlen, strcpy, strncpy and strcat" 2024-07-05 19:02:21 +02:00
powerpc powerpc/perf: Invoke per-CPU variable access with disabled interrupts 2024-07-05 19:01:01 +02:00
riscv riscv: Fixup patch_text panic in ftrace 2024-07-05 19:01:00 +02:00
s390 KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2024-07-05 19:13:47 +02:00
sh sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
sparc init: add dsm gpl source 2024-07-05 18:00:04 +02:00
um um: fix error return code in winch_tramp() 2021-07-20 16:05:51 +02:00
x86 Revert "KVM: x86: mmu: Add guest physical address check in translate_gpa()" 2024-07-05 19:13:47 +02:00
xtensa xtensa: fix kconfig unmet dependency warning for HAVE_FUTEX_CMPXCHG 2024-07-05 19:04:23 +02:00
.gitignore
Kconfig fanotify: Fix sys_fanotify_mark() on native x86-32 2021-01-17 14:16:59 +01:00