android_kernel_motorola_sm6375/arch/s390
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Halil Pasic 20fff3ef33 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 <[email protected]>
Reviewed-by: Christian Bornträger <[email protected]>
Reviewed-by: Claudio Imbrenda <[email protected]>
Cc: <[email protected]> # 3.15+
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Borntraeger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-09-15 09:47:40 +02:00
..
appldata
boot s390/boot: fix use of expolines in the DMA code 2021-07-28 13:30:58 +02:00
configs
crypto s390/archrandom: add parameter check for s390_arch_random_generate 2021-05-11 14:04:13 +02:00
hypfs
include KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2021-09-15 09:47:40 +02:00
kernel s390/debug: fix debug area life cycle 2021-09-15 09:47:28 +02:00
kvm KVM: s390: index kvm->arch.idle_mask by vcpu_idx 2021-09-15 09:47:40 +02:00
lib s390/mm: fix page table upgrade vs 2ndary address mode accesses 2020-04-29 16:33:25 +02:00
mm s390/kasan: fix large PMD pages address alignment check 2021-09-15 09:47:28 +02:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
numa s390/numa: set node distance to LOCAL_DISTANCE 2020-09-03 11:26:50 +02:00
oprofile
pci s390/pci: Log new handle in clp_disable_fh() 2020-06-17 16:40:23 +02:00
purgatory s390/kexec_file: fix diag308 subcode when loading crash kernel 2020-12-30 11:51:34 +01:00
scripts
tools
Kbuild
Kconfig s390: appldata depends on PROC_SYSCTL 2021-07-14 16:53:42 +02:00
Kconfig.debug
Makefile