]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live
authorNicholas Piggin <npiggin@gmail.com>
Wed, 11 Aug 2021 16:00:43 +0000 (02:00 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Aug 2021 06:37:18 +0000 (16:37 +1000)
commit1782663897945a5cf28e564ba5eed730098e9aa4
tree82ddfdaa26a815e27a79cad06c51c0a29e5c4f14
parentf2e29db156523bf08a0524e0f4306a641912c6d9
KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live

After the L1 saves its PMU SPRs but before loading the L2's PMU SPRs,
switch the pmcregs_in_use field in the L1 lppaca to the value advertised
by the L2 in its VPA. On the way out of the L2, set it back after saving
the L2 PMU registers (if they were in-use).

This transfers the PMU liveness indication between the L1 and L2 at the
points where the registers are not live.

This fixes the nested HV bug for which a workaround was added to the L0
HV by commit 63279eeb7f93a ("KVM: PPC: Book3S HV: Always save guest pmu
for guest capable of nesting"), which explains the problem in detail.
That workaround is no longer required for guests that include this bug
fix.

Fixes: 360cae313702 ("KVM: PPC: Book3S HV: Nested guest entry via hypercall")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Link: https://lore.kernel.org/r/20210811160134.904987-10-npiggin@gmail.com
arch/powerpc/include/asm/pmc.h
arch/powerpc/kvm/book3s_hv.c