[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 04/41] target/arm: Add TTBR1_EL2
From: |
Richard Henderson |
Subject: |
[PATCH v7 04/41] target/arm: Add TTBR1_EL2 |
Date: |
Thu, 6 Feb 2020 10:54:11 +0000 |
At the same time, add writefn to TTBR0_EL2 and TCR_EL2.
A later patch will update any ASID therein.
Tested-by: Alex Bennée <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
v5: Do not update TCR_EL2 yet; delay that til we handle ASIDs.
---
target/arm/helper.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index fe7991864a..c7ee0d603f 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -3533,6 +3533,13 @@ static void vmsa_ttbr_write(CPUARMState *env, const
ARMCPRegInfo *ri,
raw_write(env, ri, value);
}
+static void vmsa_tcr_ttbr_el2_write(CPUARMState *env, const ARMCPRegInfo *ri,
+ uint64_t value)
+{
+ /* TODO: There are ASID fields in here with HCR_EL2.E2H */
+ raw_write(env, ri, value);
+}
+
static void vttbr_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
@@ -4979,7 +4986,7 @@ static const ARMCPRegInfo el2_cp_reginfo[] = {
.fieldoffset = offsetof(CPUARMState, cp15.tpidr_el[2]) },
{ .name = "TTBR0_EL2", .state = ARM_CP_STATE_AA64,
.opc0 = 3, .opc1 = 4, .crn = 2, .crm = 0, .opc2 = 0,
- .access = PL2_RW, .resetvalue = 0,
+ .access = PL2_RW, .resetvalue = 0, .writefn = vmsa_tcr_ttbr_el2_write,
.fieldoffset = offsetof(CPUARMState, cp15.ttbr0_el[2]) },
{ .name = "HTTBR", .cp = 15, .opc1 = 4, .crm = 2,
.access = PL2_RW, .type = ARM_CP_64BIT | ARM_CP_ALIAS,
@@ -6131,6 +6138,10 @@ static const ARMCPRegInfo vhe_reginfo[] = {
.opc0 = 3, .opc1 = 4, .crn = 13, .crm = 0, .opc2 = 1,
.access = PL2_RW,
.fieldoffset = offsetof(CPUARMState, cp15.contextidr_el[2]) },
+ { .name = "TTBR1_EL2", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 4, .crn = 2, .crm = 0, .opc2 = 1,
+ .access = PL2_RW, .writefn = vmsa_tcr_ttbr_el2_write,
+ .fieldoffset = offsetof(CPUARMState, cp15.ttbr1_el[2]) },
REGINFO_SENTINEL
};
--
2.20.1
- [PATCH v7 00/41] target/arm: Implement ARMv8.1-VHE, Richard Henderson, 2020/02/06
- [PATCH v7 01/41] target/arm: Define isar_feature_aa64_vh, Richard Henderson, 2020/02/06
- [PATCH v7 02/41] target/arm: Enable HCR_E2H for VHE, Richard Henderson, 2020/02/06
- [PATCH v7 03/41] target/arm: Add CONTEXTIDR_EL2, Richard Henderson, 2020/02/06
- [PATCH v7 04/41] target/arm: Add TTBR1_EL2,
Richard Henderson <=
- [PATCH v7 06/41] target/arm: Split out vae1_tlbmask, Richard Henderson, 2020/02/06
- [PATCH v7 05/41] target/arm: Update CNTVCT_EL0 for VHE, Richard Henderson, 2020/02/06
- [PATCH v7 08/41] target/arm: Simplify tlb_force_broadcast alternatives, Richard Henderson, 2020/02/06
- [PATCH v7 09/41] target/arm: Rename ARMMMUIdx*_S12NSE* to ARMMMUIdx*_E10_*, Richard Henderson, 2020/02/06
- [PATCH v7 10/41] target/arm: Rename ARMMMUIdx_S2NS to ARMMMUIdx_Stage2, Richard Henderson, 2020/02/06
- [PATCH v7 11/41] target/arm: Rename ARMMMUIdx_S1NSE* to ARMMMUIdx_Stage1_E*, Richard Henderson, 2020/02/06
- [PATCH v7 14/41] target/arm: Rename ARMMMUIdx_S1E2 to ARMMMUIdx_E2, Richard Henderson, 2020/02/06
- [PATCH v7 16/41] target/arm: Expand TBFLAG_ANY.MMUIDX to 4 bits, Richard Henderson, 2020/02/06
- [PATCH v7 07/41] target/arm: Split out alle1_tlbmask, Richard Henderson, 2020/02/06
- [PATCH v7 12/41] target/arm: Rename ARMMMUIdx_S1SE[01] to ARMMMUIdx_SE10_[01], Richard Henderson, 2020/02/06