aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorVictor Kamensky <victor.kamensky@linaro.org>2014-07-02 17:19:30 +0100
committerChristoffer Dall <christoffer.dall@linaro.org>2014-07-11 04:57:43 -0700
commitf0a3eaff71b8bd5d5acfda1f0cf3eedf49755622 (patch)
tree151ffee47494baad44c4f6838219d4852579bf2d /arch/arm64/include
parentARM64: KVM: set and get of sys registers in BE case (diff)
downloadlinux-dev-f0a3eaff71b8bd5d5acfda1f0cf3eedf49755622.tar.xz
linux-dev-f0a3eaff71b8bd5d5acfda1f0cf3eedf49755622.zip
ARM64: KVM: fix big endian issue in access_vm_reg for 32bit guest
Fix issue with 32bit guests running on top of BE KVM host. Indexes of high and low words of 64bit cp15 register are swapped in case of big endian code, since 64bit cp15 state is restored or saved with double word write or read instruction. Define helper macro to access low words of 64bit cp15 register. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/kvm_host.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 4ae9213aa997..503c70661636 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -140,6 +140,12 @@ struct kvm_vcpu_arch {
#define vcpu_sys_reg(v,r) ((v)->arch.ctxt.sys_regs[(r)])
#define vcpu_cp15(v,r) ((v)->arch.ctxt.cp15[(r)])
+#ifdef CONFIG_CPU_BIG_ENDIAN
+#define vcpu_cp15_64_low(v,r) ((v)->arch.ctxt.cp15[((r) + 1)])
+#else
+#define vcpu_cp15_64_low(v,r) ((v)->arch.ctxt.cp15[((r) + 0)])
+#endif
+
struct kvm_vm_stat {
u32 remote_tlb_flush;
};