]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs
authorNicholas Piggin <npiggin@gmail.com>
Sat, 22 Jan 2022 10:55:30 +0000 (20:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 25 Jan 2022 05:39:41 +0000 (16:39 +1100)
commitf42a77609a5fb651ff0bb8776029b122d929e4ac
tree88931127028694933a1005e6c25c94d4ad75ce89
parentf68fe0dbbc8fdb1759854622004888cf5d908570
KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs

The L0 is storing HFSCR requested by the L1 for the L2 in struct
kvm_nested_guest when the L1 requests a vCPU enter L2. kvm_nested_guest
is not a per-vCPU structure. Hilarity ensues.

Fix it by moving the nested hfscr into the vCPU structure together with
the other per-vCPU nested fields.

Fixes: ad47d9e0feb8 ("KVM: PPC: Book3S HV Nested: Make nested HFSCR state accessible")
Cc: stable@vger.kernel.org # v5.15+
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220122105530.3477250-1-npiggin@gmail.com
arch/powerpc/include/asm/kvm_book3s_64.h
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_nested.c