KVM: PPC: Book3S HV P9: Switch PMU to guest as late as possible
authorNicholas Piggin <npiggin@gmail.com>
Tue, 23 Nov 2021 09:52:11 +0000 (19:52 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 24 Nov 2021 10:09:00 +0000 (21:09 +1100)
commit3e7b3379023dad2e78c3200373a6368f5d0ee599
tree6ee4abd9ea5dcacfa3b89688a4b8f98b4cf18257
parent3f9e2966d1b0dd81bcfaeb816335e0ddeedde3c1
KVM: PPC: Book3S HV P9: Switch PMU to guest as late as possible

This moves PMU switch to guest as late as possible in entry, and switch
back to host as early as possible at exit. This helps the host get the
most perf coverage of KVM entry/exit code as possible.

This is slightly suboptimal for SPR scheduling point of view when the
PMU is enabled, but when perf is disabled there is no real difference.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211123095231.1036501-34-npiggin@gmail.com
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_p9_entry.c