ARM64: KVM: store kvm_vcpu_fault_info est_el2 as word
authorVictor Kamensky <victor.kamensky@linaro.org>
Thu, 12 Jun 2014 16:30:09 +0000 (09:30 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Fri, 11 Jul 2014 11:57:41 +0000 (04:57 -0700)
esr_el2 field of struct kvm_vcpu_fault_info has u32 type.
It should be stored as word. Current code works in LE case
because existing puts least significant word of x1 into
esr_el2, and it puts most significant work of x1 into next
field, which accidentally is OK because it is updated again
by next instruction. But existing code breaks in BE case.

Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/kvm/hyp.S

index 5945f3b..7874e02 100644 (file)
@@ -762,7 +762,7 @@ el1_trap:
        mrs     x2, far_el2
 
 2:     mrs     x0, tpidr_el2
-       str     x1, [x0, #VCPU_ESR_EL2]
+       str     w1, [x0, #VCPU_ESR_EL2]
        str     x2, [x0, #VCPU_FAR_EL2]
        str     x3, [x0, #VCPU_HPFAR_EL2]