]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 5 Nov 2021 09:18:03 +0000 (10:18 +0100)
commitb6f3bdc3f4cc926141940f521a8e69431a4309f8
treef33c7366f29a53289fa395f95c545f201222dadd
parentefba9c41281954aee01b96d771e338667e55e38c
KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live

BugLink: https://bugs.launchpad.net/bugs/1947781
[ Upstream commit 1782663897945a5cf28e564ba5eed730098e9aa4 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/powerpc/include/asm/pmc.h
arch/powerpc/kvm/book3s_hv.c