FIELD(ID_AA64PFR2, MTEPERM, 0, 4)
FIELD(ID_AA64PFR2, MTESTOREONLY, 4, 4)
FIELD(ID_AA64PFR2, MTEFAR, 8, 4)
+FIELD(ID_AA64PFR2, GCIE, 12, 4)
FIELD(ID_AA64PFR2, FPMR, 32, 4)
FIELD(ID_AA64MMFR0, PARANGE, 0, 4)
return FIELD_EX64_IDREG(id, ID_AA64PFR1, GCS) != 0;
}
+static inline bool isar_feature_aa64_gcie(const ARMISARegisters *id)
+{
+ return FIELD_EX64_IDREG(id, ID_AA64PFR2, GCIE) != 0;
+}
+
static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id)
{
return FIELD_SEX64_IDREG(id, ID_AA64MMFR0, TGRAN4) >= 1;
/* Add the cpreg definitions for OMAP CP15 regs */
void define_omap_cp_regs(ARMCPU *cpu);
+/* Add the cpreg definitions for the GICv5 CPU interface */
+void define_gicv5_cpuif_regs(ARMCPU *cpu);
+
/* Effective value of MDCR_EL2 */
static inline uint64_t arm_mdcr_el2_eff(CPUARMState *env)
{
--- /dev/null
+/*
+ * GICv5 CPU interface
+ *
+ * Copyright (c) 2025 Linaro Limited
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+#include "internals.h"
+#include "cpregs.h"
+
+static const ARMCPRegInfo gicv5_cpuif_reginfo[] = {
+ /*
+ * Barrier: wait until the effects of a cpuif system register
+ * write have definitely made it to the IRS (and will thus show up
+ * in cpuif reads from the IRS by this or other CPUs and in the
+ * status of IRQ, FIQ etc). For QEMU we do all interaction with
+ * the IRS synchronously, so we can make this a nop.
+ */
+ { .name = "GSB_SYS", .state = ARM_CP_STATE_AA64,
+ .opc0 = 1, .opc1 = 0, .crn = 12, .crm = 0, .opc2 = 0,
+ .access = PL1_W, .type = ARM_CP_NOP,
+ },
+ /*
+ * Barrier: wait until the effects of acknowledging an interrupt
+ * (via GICR CDIA or GICR CDNMIA) are visible, including the
+ * effect on the {IRQ,FIQ,vIRQ,vFIQ} pending state. This is a
+ * weaker version of GSB SYS. Again, for QEMU this is a nop.
+ */
+ { .name = "GSB_ACK", .state = ARM_CP_STATE_AA64,
+ .opc0 = 1, .opc1 = 0, .crn = 12, .crm = 0, .opc2 = 1,
+ .access = PL1_W, .type = ARM_CP_NOP,
+ },
+};
+
+void define_gicv5_cpuif_regs(ARMCPU *cpu)
+{
+ if (cpu_isar_feature(aa64_gcie, cpu)) {
+ define_arm_cp_regs(cpu, gicv5_cpuif_reginfo);
+ }
+}