KVM: PPC: Book3S HV Nested: Avoid extra mftb() in nested entry
authorNicholas Piggin <npiggin@gmail.com>
Tue, 23 Nov 2021 09:52:22 +0000 (19:52 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 24 Nov 2021 10:09:02 +0000 (21:09 +1100)
commit46dea77f790c1e7ab2e9f7452e34de0dc5da9b13
treeaf24a8dc8afc9b6493cd93ee7b9d296516edcde4
parentd5c0e8332d82c04deee25dd6f28c5bbe84d49a73
KVM: PPC: Book3S HV Nested: Avoid extra mftb() in nested entry

mftb() is expensive and one can be avoided on nested guest dispatch.

If the time checking code distinguishes between the L0 timer and the
nested HV timer, then both can be tested in the same place with the
same mftb() value.

This also nicely illustrates the relationship between the L0 and nested
HV timers.

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-45-npiggin@gmail.com
arch/powerpc/include/asm/kvm_asm.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_hv_nested.c