Commit 8823a8fd authored by Mihai Caraman's avatar Mihai Caraman Committed by Alexander Graf

KVM: PPC: Mask ea's high 32-bits in 32/64 instr emulation

Mask high 32 bits of effective address in emulation layer for guests running
in 32-bit mode.
Signed-off-by: default avatarMihai Caraman <mihai.caraman@freescale.com>
[agraf: fix indent]
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 7cdd7a95
...@@ -298,11 +298,21 @@ static inline void kvmppc_lazy_ee_enable(void) ...@@ -298,11 +298,21 @@ static inline void kvmppc_lazy_ee_enable(void)
static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb)
{ {
ulong ea; ulong ea;
ulong msr_64bit = 0;
ea = kvmppc_get_gpr(vcpu, rb); ea = kvmppc_get_gpr(vcpu, rb);
if (ra) if (ra)
ea += kvmppc_get_gpr(vcpu, ra); ea += kvmppc_get_gpr(vcpu, ra);
#if defined(CONFIG_PPC_BOOK3E_64)
msr_64bit = MSR_CM;
#elif defined(CONFIG_PPC_BOOK3S_64)
msr_64bit = MSR_SF;
#endif
if (!(vcpu->arch.shared->msr & msr_64bit))
ea = (uint32_t)ea;
return ea; return ea;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment