From 25daa5363e6371c7cb1658a0030a46505661c98d Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Sat, 24 Feb 2018 16:24:49 -0500 Subject: [PATCH] target-arm: Add the HSTR_EL2 register Add the Hypervisor System Trap Register for EL2. This register is used early in the Linux boot and without it the kernel aborts with a "Synchronous Abort" error. Backports commit 2a5a9abd4bc45e2f4c62c77e07aebe53608c6915 from qemu --- qemu/target-arm/cpu.h | 1 + qemu/target-arm/helper.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/qemu/target-arm/cpu.h b/qemu/target-arm/cpu.h index 232aecc7..d33944ae 100644 --- a/qemu/target-arm/cpu.h +++ b/qemu/target-arm/cpu.h @@ -280,6 +280,7 @@ typedef struct CPUARMState { uint64_t far_el[4]; }; uint64_t hpfar_el2; + uint64_t hstr_el2; union { /* Translation result. */ struct { uint64_t _unused_par_0; diff --git a/qemu/target-arm/helper.c b/qemu/target-arm/helper.c index 7874f389..9315886e 100644 --- a/qemu/target-arm/helper.c +++ b/qemu/target-arm/helper.c @@ -3064,6 +3064,8 @@ static const ARMCPRegInfo el3_no_el2_cp_reginfo[] = { { "HPFAR_EL2", 0,6,0, 3,4,4, ARM_CP_STATE_BOTH, ARM_CP_CONST, PL2_RW, 0, NULL, 0, 0, {0, 0}, access_el3_aa32ns_aa64any }, + { "HSTR_EL2", 0,1,1, 3,4,3, ARM_CP_STATE_BOTH, ARM_CP_CONST, + PL2_RW, 0, NULL, 0 }, REGINFO_SENTINEL }; @@ -3232,6 +3234,8 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { access_el3_aa32ns }, { "HPFAR_EL2", 0,6,0, 3,4,4, ARM_CP_STATE_AA64, 0, PL2_RW, 0, NULL, 0, offsetof(CPUARMState, cp15.hpfar_el2) }, + { "HSTR_EL2", 15,1,1, 3,4,3, ARM_CP_STATE_BOTH, 0, + PL2_RW, 0, NULL, 0, offsetof(CPUARMState, cp15.hstr_el2) }, REGINFO_SENTINEL };