]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:25 +0000 (12:26 +0200)
commit43ef8a6c2cec1e93c29aee4f4dc121532672d2a5
tree3e977d7e7f487d7e16bfdb6554767fabbdcfb5f8
parentde149ef681dd9f4a8cbbd3176a9ed0bd14806c5d
KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live

[ 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 2c3af6797948d ("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: f1e67fa047b1 ("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>
arch/powerpc/include/asm/pmc.h
arch/powerpc/kvm/book3s_hv.c