diff options
author | Mihai Caraman <mihai.caraman@freescale.com> | 2012-10-11 02:13:23 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-12-05 19:34:13 -0500 |
commit | 8823a8fd0d730612f12a87102503622c01eb2468 (patch) | |
tree | dae1cb536df441b60759271dd6421b309fcf7591 /arch | |
parent | 7cdd7a95c66a6309ae6156471033fb5375cbcfca (diff) |
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: Mihai Caraman <mihai.caraman@freescale.com>
[agraf: fix indent]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/kvm_ppc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index d55a2b28706e..572aa7530619 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h | |||
@@ -298,11 +298,21 @@ static inline void kvmppc_lazy_ee_enable(void) | |||
298 | static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) | 298 | static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) |
299 | { | 299 | { |
300 | ulong ea; | 300 | ulong ea; |
301 | ulong msr_64bit = 0; | ||
301 | 302 | ||
302 | ea = kvmppc_get_gpr(vcpu, rb); | 303 | ea = kvmppc_get_gpr(vcpu, rb); |
303 | if (ra) | 304 | if (ra) |
304 | ea += kvmppc_get_gpr(vcpu, ra); | 305 | ea += kvmppc_get_gpr(vcpu, ra); |
305 | 306 | ||
307 | #if defined(CONFIG_PPC_BOOK3E_64) | ||
308 | msr_64bit = MSR_CM; | ||
309 | #elif defined(CONFIG_PPC_BOOK3S_64) | ||
310 | msr_64bit = MSR_SF; | ||
311 | #endif | ||
312 | |||
313 | if (!(vcpu->arch.shared->msr & msr_64bit)) | ||
314 | ea = (uint32_t)ea; | ||
315 | |||
306 | return ea; | 316 | return ea; |
307 | } | 317 | } |
308 | 318 | ||