cpu_isar_feature(aa64_s2pie, cpu)) {
valid_mask |= SCR_PIEN;
}
+ if (cpu_isar_feature(aa64_aie, cpu)) {
+ valid_mask |= SCR_AIEN;
+ }
if (cpu_isar_feature(aa64_mec, cpu)) {
valid_mask |= SCR_MECEN;
}
.fieldoffset = offsetof(CPUARMState, cp15.s2pir_el2) },
};
+static CPAccessResult aien_access(CPUARMState *env, const ARMCPRegInfo *ri,
+ bool isread)
+{
+ if (arm_feature(env, ARM_FEATURE_EL3)
+ && !(env->cp15.scr_el3 & SCR_AIEN)
+ && arm_current_el(env) < 3) {
+ return CP_ACCESS_TRAP_EL3;
+ }
+ return CP_ACCESS_OK;
+}
+
+static CPAccessResult aien_el1_access(CPUARMState *env, const ARMCPRegInfo *ri,
+ bool isread)
+{
+ CPAccessResult ret = access_tvm_trvm(env, ri, isread);
+ if (ret == CP_ACCESS_OK) {
+ ret = aien_access(env, ri, isread);
+ }
+ return ret;
+}
+
+static const ARMCPRegInfo aie_reginfo[] = {
+ { .name = "MAIR2_EL1", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 1,
+ .access = PL1_RW, .accessfn = aien_el1_access,
+ .fgt = FGT_NMAIR2_EL1, .nv2_redirect_offset = 0x280 | NV2_REDIR_NV1,
+ .vhe_redir_to_el2 = ENCODE_AA64_CP_REG(3, 4, 10, 1, 1),
+ .vhe_redir_to_el01 = ENCODE_AA64_CP_REG(3, 5, 10, 2, 1),
+ .fieldoffset = offsetof(CPUARMState, cp15.mair2_el[1]) },
+ { .name = "MAIR2_EL2", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 4, .crn = 10, .crm = 1, .opc2 = 1,
+ .access = PL2_RW, .accessfn = aien_access,
+ .fieldoffset = offsetof(CPUARMState, cp15.mair2_el[2]) },
+ { .name = "MAIR2_EL3", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 6, .crn = 10, .crm = 1, .opc2 = 1,
+ .access = PL3_RW,
+ .fieldoffset = offsetof(CPUARMState, cp15.mair2_el[3]) },
+
+ { .name = "AMAIR2_EL1", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 0, .crn = 10, .crm = 3, .opc2 = 1,
+ .access = PL1_RW, .accessfn = aien_el1_access,
+ .fgt = FGT_NAMAIR2_EL1, .nv2_redirect_offset = 0x288 | NV2_REDIR_NV1,
+ .vhe_redir_to_el2 = ENCODE_AA64_CP_REG(3, 4, 10, 3, 1),
+ .vhe_redir_to_el01 = ENCODE_AA64_CP_REG(3, 5, 10, 3, 1),
+ .type = ARM_CP_CONST, .resetvalue = 0 },
+ { .name = "AMAIR2_EL2", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 4, .crn = 10, .crm = 3, .opc2 = 1,
+ .access = PL2_RW, .accessfn = aien_access,
+ .type = ARM_CP_CONST, .resetvalue = 0 },
+ { .name = "AMAIR2_EL3", .state = ARM_CP_STATE_AA64,
+ .opc0 = 3, .opc1 = 6, .crn = 10, .crm = 3, .opc2 = 1,
+ .access = PL3_RW,
+ .type = ARM_CP_CONST, .resetvalue = 0 },
+};
+
void register_cp_regs_for_features(ARMCPU *cpu)
{
/* Register all the coprocessor registers based on feature bits */
}
}
+ if (cpu_isar_feature(aa64_aie, cpu)) {
+ define_arm_cp_regs(cpu, aie_reginfo);
+ }
+
if (cpu_isar_feature(any_predinv, cpu)) {
define_arm_cp_regs(cpu, predinv_reginfo);
}