]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: traps: Don't define FAR_EL2 for ARM32
authorJulien Grall <julien.grall@arm.com>
Fri, 15 Sep 2017 23:45:59 +0000 (16:45 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 20 Sep 2017 00:17:03 +0000 (17:17 -0700)
Aliasing FAR_EL2 to HIFAR makes the code confusing because on ARMv8
FAR_EL2[31:0] is architecturally mapped to HDFAR and FAR_EL2[63:32] to
HIFAR. See D7.2.30 in ARM DDI 0487B.a. Open-code the alias instead.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c
xen/include/asm-arm/cpregs.h

index 5e6bc3173fa35535bc662ee9430529c9222e003f..200cf16b64fa3cbd57408b2627fd8704c26fb7da 100644 (file)
@@ -1961,11 +1961,17 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs,
                                       const union hsr hsr)
 {
     int rc;
-    register_t gva = READ_SYSREG(FAR_EL2);
+    register_t gva;
     uint8_t fsc = hsr.iabt.ifsc & ~FSC_LL_MASK;
     paddr_t gpa;
     mfn_t mfn;
 
+#ifdef CONFIG_ARM_32
+    gva = READ_CP32(HIFAR);
+#else
+    gva = READ_SYSREG64(FAR_EL2);
+#endif
+
     /*
      * If this bit has been set, it means that this instruction abort is caused
      * by a guest external abort. We can handle this instruction abort as guest
index af45ec7a65e33a72b6877f72c53ca81d14579d41..1889d7cbfbf1129215a57d33a10bec479a4004cb 100644 (file)
 #define ESR_EL1                 DFSR
 #define ESR_EL2                 HSR
 #define FAR_EL1                 HIFAR
-#define FAR_EL2                 HIFAR
 #define HCR_EL2                 HCR
 #define HPFAR_EL2               HPFAR
 #define HSTR_EL2                HSTR