diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-11-23 12:52:00 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-11-24 13:08:59 +0300 |
commit | 3c1a4322bba79aad2d3f6f996b7e1c336bd909b3 (patch) | |
tree | 8a40c495102958ac41fe35883b68b1f13501b321 /arch/powerpc/include/asm/kvm_book3s.h | |
parent | cf99dedb4b2d2a18e004b1c84852fffa810dc44c (diff) | |
download | linux-3c1a4322bba79aad2d3f6f996b7e1c336bd909b3.tar.xz |
KVM: PPC: Book3S HV: Change dec_expires to be relative to guest timebase
Change dec_expires to be relative to the guest timebase, and allow
it to be moved into low level P9 guest entry functions, to improve
SPR access scheduling.
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-23-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/include/asm/kvm_book3s.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index 3d31f2c59e43..91c9f937edcd 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h @@ -406,6 +406,12 @@ static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu) return vcpu->arch.fault_dar; } +/* Expiry time of vcpu DEC relative to host TB */ +static inline u64 kvmppc_dec_expires_host_tb(struct kvm_vcpu *vcpu) +{ + return vcpu->arch.dec_expires - vcpu->arch.vcore->tb_offset; +} + static inline bool is_kvmppc_resume_guest(int r) { return (r == RESUME_GUEST || r == RESUME_GUEST_NV); |