* [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu
@ 2025-10-06 0:10 Gustavo Romero
2025-10-06 0:10 ` [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV Gustavo Romero
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Gustavo Romero @ 2025-10-06 0:10 UTC (permalink / raw)
To: qemu-devel, qemu-arm, richard.henderson, peter.maydell
Cc: alex.bennee, gustavo.romero
This series adds support for all FEAT_MEC registers and cache
instructions to the Arm64 max CPU.
It includes the FEAT_MEC registers and cache maintenance instructions,
but does not modify the translation regimes to support the MECIDs, so no
encryption is supported yet. However, software stacks that rely on
FEAT_MEC should work properly at this point.
Cheers,
Gustavo
v10:
- Addressed comment from pm215 that registers with opc1 == 4 or 5 must
actually not trap when nested virtualization is turned on. This
resulted in one additional patch in the series:
"Add a cpreg flag to indicate no trap in NV".
All previous versions of this series can be found in:
https://patchew.org/QEMU/20250727074202.83141-1-richard.henderson@linaro.org/
Please note that the patches related to FEAT_SCTRL2 and FEAT_TCR2, which
are prerequisites for this series, have already been merged into master.
Gustavo Romero (3):
target/arm: Add a cpreg flag to indicate no trap in NV
target/arm: Implement FEAT_MEC registers
target/arm: Enable FEAT_MEC in -cpu max
docs/system/arm/emulation.rst | 3 +
target/arm/cpregs.h | 11 +++-
target/arm/cpu-features.h | 5 ++
target/arm/cpu.c | 3 +
target/arm/cpu.h | 10 ++++
target/arm/helper.c | 109 ++++++++++++++++++++++++++++++++++
target/arm/internals.h | 3 +
target/arm/tcg/cpu64.c | 1 +
8 files changed, 142 insertions(+), 3 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV 2025-10-06 0:10 [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Gustavo Romero @ 2025-10-06 0:10 ` Gustavo Romero 2025-10-07 14:31 ` Peter Maydell 2025-10-06 0:10 ` [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers Gustavo Romero ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Gustavo Romero @ 2025-10-06 0:10 UTC (permalink / raw) To: qemu-devel, qemu-arm, richard.henderson, peter.maydell Cc: alex.bennee, gustavo.romero Add a new flag, ARM_CP_NV_NO_TRAP, to indicate that a CP register, even though it has opc1 == 4 or 5, does not trap when nested virtualization is enabled (FEAT_NV/FEAT_NV2). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> --- target/arm/cpregs.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h index 57fde5f57a..abee72c9bf 100644 --- a/target/arm/cpregs.h +++ b/target/arm/cpregs.h @@ -136,6 +136,7 @@ enum { * identically to the normal one, other than FGT trapping handling.) */ ARM_CP_ADD_TLBI_NXS = 1 << 21, + ARM_CP_NV_NO_TRAP = 1 << 22, }; /* @@ -1158,10 +1159,14 @@ static inline bool arm_cpreg_traps_in_nv(const ARMCPRegInfo *ri) * * In particular, note that the released sysreg XML defines that * the FEAT_MEC sysregs and instructions do not follow this FEAT_NV - * trapping rule, so we will need to add an ARM_CP_* flag to indicate - * "register does not trap on NV" to handle those if/when we implement - * FEAT_MEC. + * trapping rule, so a register flagged as ARM_CP_NV_NO_TRAP indicates + * the register does not trap on NV even if opc1 == 4 or 5. */ + + if (ri->type & ARM_CP_NV_NO_TRAP) { + return false; + } + return ri->opc1 == 4 || ri->opc1 == 5; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV 2025-10-06 0:10 ` [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV Gustavo Romero @ 2025-10-07 14:31 ` Peter Maydell 0 siblings, 0 replies; 9+ messages in thread From: Peter Maydell @ 2025-10-07 14:31 UTC (permalink / raw) To: Gustavo Romero; +Cc: qemu-devel, qemu-arm, richard.henderson, alex.bennee On Mon, 6 Oct 2025 at 01:10, Gustavo Romero <gustavo.romero@linaro.org> wrote: > > Add a new flag, ARM_CP_NV_NO_TRAP, to indicate that a CP register, even > though it has opc1 == 4 or 5, does not trap when nested virtualization > is enabled (FEAT_NV/FEAT_NV2). > > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > --- > target/arm/cpregs.h | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h > index 57fde5f57a..abee72c9bf 100644 > --- a/target/arm/cpregs.h > +++ b/target/arm/cpregs.h > @@ -136,6 +136,7 @@ enum { > * identically to the normal one, other than FGT trapping handling.) > */ > ARM_CP_ADD_TLBI_NXS = 1 << 21, We should have a comment here documenting the flag: /* * Flag: even though this sysreg has opc1 == 4 or 5, it * should not trap to EL2 when HCR_EL2.NV is set. */ > + ARM_CP_NV_NO_TRAP = 1 << 22, > }; > > /* > @@ -1158,10 +1159,14 @@ static inline bool arm_cpreg_traps_in_nv(const ARMCPRegInfo *ri) > * > * In particular, note that the released sysreg XML defines that > * the FEAT_MEC sysregs and instructions do not follow this FEAT_NV > - * trapping rule, so we will need to add an ARM_CP_* flag to indicate > - * "register does not trap on NV" to handle those if/when we implement > - * FEAT_MEC. > + * trapping rule, so a register flagged as ARM_CP_NV_NO_TRAP indicates > + * the register does not trap on NV even if opc1 == 4 or 5. FEAT_MEC is in the Arm ARM now, so we can drop the reference to the sysreg XML while we're touching this comment: In particular, note that the FEAT_MEC sysregs and instructions are exceptions to this trapping rule, so they are marked as ARM_CP_NV_NO_TRAP to indicate that they should not be trapped to EL2. > */ > + > + if (ri->type & ARM_CP_NV_NO_TRAP) { > + return false; > + } > + > return ri->opc1 == 4 || ri->opc1 == 5; > } Code changes look good. thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers 2025-10-06 0:10 [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Gustavo Romero 2025-10-06 0:10 ` [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV Gustavo Romero @ 2025-10-06 0:10 ` Gustavo Romero 2025-10-07 14:32 ` Peter Maydell 2025-10-06 0:10 ` [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max Gustavo Romero 2025-10-07 14:35 ` [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Peter Maydell 3 siblings, 1 reply; 9+ messages in thread From: Gustavo Romero @ 2025-10-06 0:10 UTC (permalink / raw) To: qemu-devel, qemu-arm, richard.henderson, peter.maydell Cc: alex.bennee, gustavo.romero Add all FEAT_MEC registers. Enable access to the registers via the SCTLR2 and TCR2 control bits. Add the two new cache management instructions, which are nops in QEMU because we do not model caches. Message-ID: <20250711140828.1714666-3-gustavo.romero@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> [rth: Squash 3 patches to add all registers at once.] Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> --- target/arm/cpu-features.h | 5 ++ target/arm/cpu.c | 3 ++ target/arm/cpu.h | 10 ++++ target/arm/helper.c | 109 ++++++++++++++++++++++++++++++++++++++ target/arm/internals.h | 3 ++ 5 files changed, 130 insertions(+) diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index 602f6a88e5..206c807530 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -1344,6 +1344,11 @@ static inline bool isar_feature_aa64_sctlr2(const ARMISARegisters *id) return FIELD_EX64_IDREG(id, ID_AA64MMFR3, SCTLRX) != 0; } +static inline bool isar_feature_aa64_mec(const ARMISARegisters *id) +{ + return FIELD_EX64_IDREG(id, ID_AA64MMFR3, MEC) != 0; +} + static inline bool isar_feature_aa64_pmuv3p1(const ARMISARegisters *id) { return FIELD_EX64_IDREG(id, ID_AA64DFR0, PMUVER) >= 4 && diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 30e29fd315..baab2ff9b6 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -641,6 +641,9 @@ void arm_emulate_firmware_reset(CPUState *cpustate, int target_el) if (cpu_isar_feature(aa64_sctlr2, cpu)) { env->cp15.scr_el3 |= SCR_SCTLR2EN; } + if (cpu_isar_feature(aa64_mec, cpu)) { + env->cp15.scr_el3 |= SCR_MECEN; + } } if (target_el == 2) { diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 2b9585dc80..6b9613a5d3 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -576,6 +576,15 @@ typedef struct CPUArchState { /* NV2 register */ uint64_t vncr_el2; + + /* MEC registers */ + uint64_t mecid_p0_el2; + uint64_t mecid_a0_el2; + uint64_t mecid_p1_el2; + uint64_t mecid_a1_el2; + uint64_t mecid_rl_a_el3; + uint64_t vmecid_p_el2; + uint64_t vmecid_a_el2; } cp15; struct { @@ -1721,6 +1730,7 @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask) #define SCR_TCR2EN (1ULL << 43) #define SCR_SCTLR2EN (1ULL << 44) #define SCR_GPF (1ULL << 48) +#define SCR_MECEN (1ULL << 49) #define SCR_NSE (1ULL << 62) /* Return the current FPSCR value. */ diff --git a/target/arm/helper.c b/target/arm/helper.c index aa730addf2..c2c450617d 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -770,6 +770,9 @@ static void scr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) if (cpu_isar_feature(aa64_sctlr2, cpu)) { valid_mask |= SCR_SCTLR2EN; } + if (cpu_isar_feature(aa64_mec, cpu)) { + valid_mask |= SCR_MECEN; + } } else { valid_mask &= ~(SCR_RW | SCR_ST); if (cpu_isar_feature(aa32_ras, cpu)) { @@ -4994,6 +4997,96 @@ static const ARMCPRegInfo nmi_reginfo[] = { .resetfn = arm_cp_reset_ignore }, }; +static CPAccessResult mecid_access(CPUARMState *env, + const ARMCPRegInfo *ri, bool isread) +{ + int el = arm_current_el(env); + + if (el == 2) { + if (arm_security_space(env) != ARMSS_Realm) { + return CP_ACCESS_UNDEFINED; + } + + if (!(env->cp15.scr_el3 & SCR_MECEN)) { + return CP_ACCESS_TRAP_EL3; + } + } + + return CP_ACCESS_OK; +} + +static void mecid_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + value = extract64(value, 0, MECID_WIDTH); + raw_write(env, ri, value); +} + +static CPAccessResult cipae_access(CPUARMState *env, const ARMCPRegInfo *ri, + bool isread) +{ + switch (arm_security_space(env)) { + case ARMSS_Root: /* EL3 */ + case ARMSS_Realm: /* Realm EL2 */ + return CP_ACCESS_OK; + default: + return CP_ACCESS_UNDEFINED; + } +} + +static const ARMCPRegInfo mec_reginfo[] = { + { .name = "MECIDR_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 7, .crn = 10, .crm = 8, + .access = PL2_R, .type = ARM_CP_CONST | ARM_CP_NV_NO_TRAP, + .resetvalue = MECID_WIDTH - 1 }, + { .name = "MECID_P0_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 0, .crn = 10, .crm = 8, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.mecid_p0_el2) }, + { .name = "MECID_A0_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 1, .crn = 10, .crm = 8, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.mecid_a0_el2) }, + { .name = "MECID_P1_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 2, .crn = 10, .crm = 8, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.mecid_p1_el2) }, + { .name = "MECID_A1_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 3, .crn = 10, .crm = 8, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.mecid_a1_el2) }, + { .name = "MECID_RL_A_EL3", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 6, .opc2 = 1, .crn = 10, .crm = 10, + .access = PL3_RW, .accessfn = mecid_access, + .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.mecid_rl_a_el3) }, + { .name = "VMECID_P_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 0, .crn = 10, .crm = 9, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.vmecid_p_el2) }, + { .name = "VMECID_A_EL2", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 4, .opc2 = 1, .crn = 10, .crm = 9, + .access = PL2_RW, .type = ARM_CP_NV_NO_TRAP, + .accessfn = mecid_access, .writefn = mecid_write, + .fieldoffset = offsetof(CPUARMState, cp15.vmecid_a_el2) }, + { .name = "DC_CIPAE", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 14, .opc2 = 0, + .access = PL2_W, .type = ARM_CP_NOP | ARM_CP_NV_NO_TRAP, + .accessfn = cipae_access }, +}; + +static const ARMCPRegInfo mec_mte_reginfo[] = { + { .name = "DC_CIGDPAE", .state = ARM_CP_STATE_AA64, + .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 14, .opc2 = 7, + .access = PL2_W, .type = ARM_CP_NOP | ARM_CP_NV_NO_TRAP, + .accessfn = cipae_access }, +}; + #ifndef CONFIG_USER_ONLY /* * We don't know until after realize whether there's a GICv3 @@ -5836,6 +5929,9 @@ static void sctlr2_el2_write(CPUARMState *env, const ARMCPRegInfo *ri, { uint64_t valid_mask = 0; + if (cpu_isar_feature(aa64_mec, env_archcpu(env))) { + valid_mask |= SCTLR2_EMEC; + } value &= valid_mask; raw_write(env, ri, value); } @@ -5845,6 +5941,9 @@ static void sctlr2_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, { uint64_t valid_mask = 0; + if (cpu_isar_feature(aa64_mec, env_archcpu(env))) { + valid_mask |= SCTLR2_EMEC; + } value &= valid_mask; raw_write(env, ri, value); } @@ -5907,6 +6006,9 @@ static void tcr2_el2_write(CPUARMState *env, const ARMCPRegInfo *ri, { uint64_t valid_mask = 0; + if (cpu_isar_feature(aa64_mec, env_archcpu(env))) { + valid_mask |= TCR2_AMEC0 | TCR2_AMEC1; + } value &= valid_mask; raw_write(env, ri, value); } @@ -7159,6 +7261,13 @@ void register_cp_regs_for_features(ARMCPU *cpu) define_arm_cp_regs(cpu, tcr2_reginfo); } + if (cpu_isar_feature(aa64_mec, cpu)) { + define_arm_cp_regs(cpu, mec_reginfo); + if (cpu_isar_feature(aa64_mte, cpu)) { + define_arm_cp_regs(cpu, mec_mte_reginfo); + } + } + if (cpu_isar_feature(any_predinv, cpu)) { define_arm_cp_regs(cpu, predinv_reginfo); } diff --git a/target/arm/internals.h b/target/arm/internals.h index 1d958dbf68..6bd9f8310c 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -2007,4 +2007,7 @@ bool arm_pan_enabled(CPUARMState *env); /* Compare uint64_t for qsort and bsearch. */ int compare_u64(const void *a, const void *b); +/* Used in FEAT_MEC to set the MECIDWidthm1 field in the MECIDR_EL2 register. */ +#define MECID_WIDTH 16 + #endif -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers 2025-10-06 0:10 ` [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers Gustavo Romero @ 2025-10-07 14:32 ` Peter Maydell 0 siblings, 0 replies; 9+ messages in thread From: Peter Maydell @ 2025-10-07 14:32 UTC (permalink / raw) To: Gustavo Romero; +Cc: qemu-devel, qemu-arm, richard.henderson, alex.bennee On Mon, 6 Oct 2025 at 01:10, Gustavo Romero <gustavo.romero@linaro.org> wrote: > > Add all FEAT_MEC registers. Enable access to the registers via the > SCTLR2 and TCR2 control bits. Add the two new cache management > instructions, which are nops in QEMU because we do not model caches. > > Message-ID: <20250711140828.1714666-3-gustavo.romero@linaro.org> > Reviewed-by: Richard Henderson <richard.henderson@linaro.org> > [rth: Squash 3 patches to add all registers at once.] > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max 2025-10-06 0:10 [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Gustavo Romero 2025-10-06 0:10 ` [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV Gustavo Romero 2025-10-06 0:10 ` [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers Gustavo Romero @ 2025-10-06 0:10 ` Gustavo Romero 2025-10-07 14:34 ` Peter Maydell 2025-10-07 14:35 ` [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Peter Maydell 3 siblings, 1 reply; 9+ messages in thread From: Gustavo Romero @ 2025-10-06 0:10 UTC (permalink / raw) To: qemu-devel, qemu-arm, richard.henderson, peter.maydell Cc: alex.bennee, gustavo.romero Advertise FEAT_MEC in AA64MMFR3 ID register for the Arm64 cpu max as a first step to fully support FEAT_MEC. The FEAT_MEC is an extension to FEAT_RME that implements multiple Memory Encryption Contexts (MEC) so the memory in a realm can be encrypted and accessing it from the wrong encryption context is not possible. An encryption context allow the selection of a memory encryption engine. At this point, no real memory encryption is supported, but software stacks that rely on FEAT_MEC should work properly. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250711140828.1714666-7-gustavo.romero@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> --- docs/system/arm/emulation.rst | 3 +++ target/arm/tcg/cpu64.c | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index 6b04c96c8c..0876a232c6 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -92,6 +92,9 @@ the following architecture extensions: - FEAT_LSE2 (Large System Extensions v2) - FEAT_LSE128 (128-bit Atomics) - FEAT_LVA (Large Virtual Address space) +- FEAT_MEC (Memory Encryption Contexts) + + * This is a register-only implementation without encryption. - FEAT_MixedEnd (Mixed-endian support) - FEAT_MixedEndEL0 (Mixed-endian support at EL0) - FEAT_MOPS (Standardization of memory operations) diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c index abef6a246e..3661f3ec83 100644 --- a/target/arm/tcg/cpu64.c +++ b/target/arm/tcg/cpu64.c @@ -1252,6 +1252,7 @@ void aarch64_max_tcg_initfn(Object *obj) t = GET_IDREG(isar, ID_AA64MMFR3); t = FIELD_DP64(t, ID_AA64MMFR3, TCRX, 1); /* FEAT_TCR2 */ t = FIELD_DP64(t, ID_AA64MMFR3, SCTLRX, 1); /* FEAT_SCTLR2 */ + t = FIELD_DP64(t, ID_AA64MMFR3, MEC, 1); /* FEAT_MEC */ t = FIELD_DP64(t, ID_AA64MMFR3, SPEC_FPACC, 1); /* FEAT_FPACC_SPEC */ SET_IDREG(isar, ID_AA64MMFR3, t); -- 2.34.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max 2025-10-06 0:10 ` [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max Gustavo Romero @ 2025-10-07 14:34 ` Peter Maydell 0 siblings, 0 replies; 9+ messages in thread From: Peter Maydell @ 2025-10-07 14:34 UTC (permalink / raw) To: Gustavo Romero; +Cc: qemu-devel, qemu-arm, richard.henderson, alex.bennee On Mon, 6 Oct 2025 at 01:10, Gustavo Romero <gustavo.romero@linaro.org> wrote: > > Advertise FEAT_MEC in AA64MMFR3 ID register for the Arm64 cpu max as a > first step to fully support FEAT_MEC. > > The FEAT_MEC is an extension to FEAT_RME that implements multiple > Memory Encryption Contexts (MEC) so the memory in a realm can be > encrypted and accessing it from the wrong encryption context is not > possible. An encryption context allow the selection of a memory > encryption engine. > > At this point, no real memory encryption is supported, but software > stacks that rely on FEAT_MEC should work properly. > > Reviewed-by: Richard Henderson <richard.henderson@linaro.org> > Message-ID: <20250711140828.1714666-7-gustavo.romero@linaro.org> > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> > --- Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu 2025-10-06 0:10 [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Gustavo Romero ` (2 preceding siblings ...) 2025-10-06 0:10 ` [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max Gustavo Romero @ 2025-10-07 14:35 ` Peter Maydell 2025-10-10 11:40 ` Peter Maydell 3 siblings, 1 reply; 9+ messages in thread From: Peter Maydell @ 2025-10-07 14:35 UTC (permalink / raw) To: Gustavo Romero; +Cc: qemu-devel, qemu-arm, richard.henderson, alex.bennee On Mon, 6 Oct 2025 at 01:10, Gustavo Romero <gustavo.romero@linaro.org> wrote: > > This series adds support for all FEAT_MEC registers and cache > instructions to the Arm64 max CPU. > > It includes the FEAT_MEC registers and cache maintenance instructions, > but does not modify the translation regimes to support the MECIDs, so no > encryption is supported yet. However, software stacks that rely on > FEAT_MEC should work properly at this point. I only had minor tweaks to suggests to comments in patch 1, so I can take this via target-arm.next and make those changes there to save you having to do another respin. (I've just sent out a pullreq, so this will be for the next one, some time next week.) thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu 2025-10-07 14:35 ` [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Peter Maydell @ 2025-10-10 11:40 ` Peter Maydell 0 siblings, 0 replies; 9+ messages in thread From: Peter Maydell @ 2025-10-10 11:40 UTC (permalink / raw) To: Gustavo Romero; +Cc: qemu-devel, qemu-arm, richard.henderson, alex.bennee On Tue, 7 Oct 2025 at 15:35, Peter Maydell <peter.maydell@linaro.org> wrote: > > On Mon, 6 Oct 2025 at 01:10, Gustavo Romero <gustavo.romero@linaro.org> wrote: > > > > This series adds support for all FEAT_MEC registers and cache > > instructions to the Arm64 max CPU. > > > > It includes the FEAT_MEC registers and cache maintenance instructions, > > but does not modify the translation regimes to support the MECIDs, so no > > encryption is supported yet. However, software stacks that rely on > > FEAT_MEC should work properly at this point. > > I only had minor tweaks to suggests to comments in patch 1, > so I can take this via target-arm.next and make those changes > there to save you having to do another respin. (I've just > sent out a pullreq, so this will be for the next one, some > time next week.) Applied to target-arm.next, thanks. -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-10 11:41 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-10-06 0:10 [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Gustavo Romero 2025-10-06 0:10 ` [PATCH v10 1/3] target/arm: Add a cpreg flag to indicate no trap in NV Gustavo Romero 2025-10-07 14:31 ` Peter Maydell 2025-10-06 0:10 ` [PATCH v10 2/3] target/arm: Implement FEAT_MEC registers Gustavo Romero 2025-10-07 14:32 ` Peter Maydell 2025-10-06 0:10 ` [PATCH v10 3/3] target/arm: Enable FEAT_MEC in -cpu max Gustavo Romero 2025-10-07 14:34 ` Peter Maydell 2025-10-07 14:35 ` [PATCH v10 0/3] target/arm: Add FEAT_MEC to max cpu Peter Maydell 2025-10-10 11:40 ` Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).