]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV P9: Factor PMU save/load into context switch functions
authorNicholas Piggin <npiggin@gmail.com>
Tue, 23 Nov 2021 09:51:52 +0000 (19:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 24 Nov 2021 10:08:58 +0000 (21:08 +1100)
commit74c06fb5178a2d694167ddc5679cf053c5b2d6dc
tree5fea6b042b9c9a5328ea8941a02729a1c7b70b8e
parent6a9bf534bd0f233a7191a2e22e3172e86f4cef26
KVM: PPC: Book3S HV P9: Factor PMU save/load into context switch functions

Rather than guest/host save/retsore functions, implement context switch
functions that take care of details like the VPA update for nested.

The reason to split these kind of helpers into explicit save/load
functions is mainly to schedule SPR access nicely, but PMU is a special
case where the load requires mtSPR (to stop counters) and other
difficulties, so there's less possibility to schedule those nicely. The
SPR accesses also have side-effects if the PMU is running, and in later
changes we keep the host PMU running as long as possible so this code
can be better profiled, which also complicates scheduling.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211123095231.1036501-15-npiggin@gmail.com
arch/powerpc/kvm/book3s_hv.c