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>
This commit is contained in:
Mihai Caraman
2012-10-11 06:13:22 +00:00
committed by Alexander Graf
parent e51f8f32d6
commit 7cdd7a95c6
4 changed files with 35 additions and 29 deletions

View File

@@ -295,4 +295,15 @@ static inline void kvmppc_lazy_ee_enable(void)
#endif
}
static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb)
{
ulong ea;
ea = kvmppc_get_gpr(vcpu, rb);
if (ra)
ea += kvmppc_get_gpr(vcpu, ra);
return ea;
}
#endif /* __POWERPC_KVM_PPC_H__ */