aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/vgic-v2-switch.S
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2014-09-28 10:04:26 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2014-10-16 04:57:41 -0400
commit2df36a5dd6792870bef48f63bfca42055ea5b79c (patch)
treeef822d51fb8cd4adb030eab48c7dab131b632461 /arch/arm64/kvm/vgic-v2-switch.S
parent3d08c629244257473450a8ba17cb8184b91e68f8 (diff)
arm/arm64: KVM: Fix BE accesses to GICv2 EISR and ELRSR regs
The EIRSR and ELRSR registers are 32-bit registers on GICv2, and we store these as an array of two such registers on the vgic vcpu struct. However, we access them as a single 64-bit value or as a bitmap pointer in the generic vgic code, which breaks BE support. Instead, store them as u64 values on the vgic structure and do the word-swapping in the assembly code, which already handles the byte order for BE systems. Tested-by: Victor Kamensky <victor.kamensky@linaro.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/kvm/vgic-v2-switch.S')
-rw-r--r--arch/arm64/kvm/vgic-v2-switch.S12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm64/kvm/vgic-v2-switch.S b/arch/arm64/kvm/vgic-v2-switch.S
index ae211772f991..f002fe1c3700 100644
--- a/arch/arm64/kvm/vgic-v2-switch.S
+++ b/arch/arm64/kvm/vgic-v2-switch.S
@@ -67,10 +67,14 @@ CPU_BE( rev w11, w11 )
67 str w4, [x3, #VGIC_V2_CPU_HCR] 67 str w4, [x3, #VGIC_V2_CPU_HCR]
68 str w5, [x3, #VGIC_V2_CPU_VMCR] 68 str w5, [x3, #VGIC_V2_CPU_VMCR]
69 str w6, [x3, #VGIC_V2_CPU_MISR] 69 str w6, [x3, #VGIC_V2_CPU_MISR]
70 str w7, [x3, #VGIC_V2_CPU_EISR] 70CPU_LE( str w7, [x3, #VGIC_V2_CPU_EISR] )
71 str w8, [x3, #(VGIC_V2_CPU_EISR + 4)] 71CPU_LE( str w8, [x3, #(VGIC_V2_CPU_EISR + 4)] )
72 str w9, [x3, #VGIC_V2_CPU_ELRSR] 72CPU_LE( str w9, [x3, #VGIC_V2_CPU_ELRSR] )
73 str w10, [x3, #(VGIC_V2_CPU_ELRSR + 4)] 73CPU_LE( str w10, [x3, #(VGIC_V2_CPU_ELRSR + 4)] )
74CPU_BE( str w7, [x3, #(VGIC_V2_CPU_EISR + 4)] )
75CPU_BE( str w8, [x3, #VGIC_V2_CPU_EISR] )
76CPU_BE( str w9, [x3, #(VGIC_V2_CPU_ELRSR + 4)] )
77CPU_BE( str w10, [x3, #VGIC_V2_CPU_ELRSR] )
74 str w11, [x3, #VGIC_V2_CPU_APR] 78 str w11, [x3, #VGIC_V2_CPU_APR]
75 79
76 /* Clear GICH_HCR */ 80 /* Clear GICH_HCR */