diff options
author | Mihai Caraman <mihai.caraman@freescale.com> | 2012-10-11 02:13:22 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-12-05 19:34:12 -0500 |
commit | 7cdd7a95c66a6309ae6156471033fb5375cbcfca (patch) | |
tree | 5a527c59bf4d162b46d3fc9cf6cab0baf5117b2b /arch/powerpc/include/asm/kvm_ppc.h | |
parent | e51f8f32d6b82f4a34dbb5781769c79b813e5694 (diff) |
KVM: PPC: e500: Add emulation helper for getting instruction ea
Add emulation helper for getting instruction ea and refactor tlb instruction
emulation to use it.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
[agraf: keep rt variable around]
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 1ca31e92ee75..d55a2b28706e 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -295,4 +295,15 @@ static inline void kvmppc_lazy_ee_enable(void) | |||
295 | #endif | 295 | #endif |
296 | } | 296 | } |
297 | 297 | ||
298 | static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) | ||
299 | { | ||
300 | ulong ea; | ||
301 | |||
302 | ea = kvmppc_get_gpr(vcpu, rb); | ||
303 | if (ra) | ||
304 | ea += kvmppc_get_gpr(vcpu, ra); | ||
305 | |||
306 | return ea; | ||
307 | } | ||
308 | |||
298 | #endif /* __POWERPC_KVM_PPC_H__ */ | 309 | #endif /* __POWERPC_KVM_PPC_H__ */ |