diff options
author | Bharat Bhushan <Bharat.Bhushan@freescale.com> | 2014-07-17 15:31:40 +0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-28 17:23:13 +0400 |
commit | 34f754b99e2f642c661967b456764b2c7ccc096e (patch) | |
tree | a6f6b187979fd35267f55c13449bbdf917442a22 /arch/powerpc/include/asm/kvm_ppc.h | |
parent | c1b8a01bf959e87cff9c9dcaf51cb5c1d60a2c52 (diff) | |
download | linux-34f754b99e2f642c661967b456764b2c7ccc096e.tar.xz |
kvm: ppc: Add SPRN_EPR get helper function
kvmppc_set_epr() is already defined in asm/kvm_ppc.h, So
rename and move get_epr helper function to same file.
Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
[agraf: remove duplicate return]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_ppc.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index c95bdbdc9d44..246fb9a7df33 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h @@ -392,6 +392,17 @@ static inline int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd) { return 0; } #endif +static inline unsigned long kvmppc_get_epr(struct kvm_vcpu *vcpu) +{ +#ifdef CONFIG_KVM_BOOKE_HV + return mfspr(SPRN_GEPR); +#elif defined(CONFIG_BOOKE) + return vcpu->arch.epr; +#else + return 0; +#endif +} + static inline void kvmppc_set_epr(struct kvm_vcpu *vcpu, u32 epr) { #ifdef CONFIG_KVM_BOOKE_HV |