mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:46:10 +00:00
target/arm: add MTX to MTEDESC and DisasContext
Add fields for MTX to DisasContext and MTEDESC. With MTE4, the fields will be needed in future patches that alter tag check, tag load and tag store behavior. Signed-off-by: Gabriel Brookman <brookmangabriel@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260529-feat-mte4-v7-6-ccbd3c14eb3c@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
6f7a2e2d46
commit
f1d78a5eae
@@ -2536,6 +2536,7 @@ FIELD(TBFLAG_A64, GCSSTR_EL, 43, 2)
|
||||
FIELD(TBFLAG_A64, FPMR_EL, 45, 2)
|
||||
FIELD(TBFLAG_A64, MTE_STORE_ONLY, 47, 1)
|
||||
FIELD(TBFLAG_A64, MTE0_STORE_ONLY, 48, 1)
|
||||
FIELD(TBFLAG_A64, MTX, 49, 2)
|
||||
|
||||
/*
|
||||
* Helpers for using the above. Note that only the A64 accessors use
|
||||
|
||||
@@ -500,6 +500,8 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el,
|
||||
}
|
||||
/* Cache TCMA as well as TBI. */
|
||||
DP_TBFLAG_A64(flags, TCMA, aa64_va_parameter_tcma(tcr, mmu_idx));
|
||||
/* Cache MTX. */
|
||||
DP_TBFLAG_A64(flags, MTX, mtx);
|
||||
}
|
||||
|
||||
if (cpu_isar_feature(aa64_gcs, env_archcpu(env))) {
|
||||
|
||||
@@ -312,6 +312,7 @@ static TCGv_i64 gen_mte_check1_mmuidx(DisasContext *s, TCGv_i64 addr,
|
||||
desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
|
||||
desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write);
|
||||
desc = FIELD_DP32(desc, MTEDESC, ALIGN, memop_alignment_bits(memop));
|
||||
desc = FIELD_DP32(desc, MTEDESC, MTX, s->mtx);
|
||||
desc = FIELD_DP32(desc, MTEDESC, SIZEM1, memop_size(memop) - 1);
|
||||
|
||||
ret = tcg_temp_new_i64();
|
||||
@@ -345,6 +346,7 @@ TCGv_i64 gen_mte_checkN(DisasContext *s, TCGv_i64 addr, bool is_write,
|
||||
desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
|
||||
desc = FIELD_DP32(desc, MTEDESC, WRITE, is_write);
|
||||
desc = FIELD_DP32(desc, MTEDESC, ALIGN, memop_alignment_bits(single_mop));
|
||||
desc = FIELD_DP32(desc, MTEDESC, MTX, s->mtx);
|
||||
desc = FIELD_DP32(desc, MTEDESC, SIZEM1, total_size - 1);
|
||||
|
||||
ret = tcg_temp_new_i64();
|
||||
@@ -3093,6 +3095,7 @@ static void handle_sys(DisasContext *s, bool isread,
|
||||
desc = FIELD_DP32(desc, MTEDESC, MIDX, get_mem_index(s));
|
||||
desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid);
|
||||
desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
|
||||
desc = FIELD_DP32(desc, MTEDESC, MTX, s->mtx);
|
||||
|
||||
tcg_rt = tcg_temp_new_i64();
|
||||
gen_helper_mte_check_zva(tcg_rt, tcg_env,
|
||||
@@ -4960,6 +4963,7 @@ static bool do_SET(DisasContext *s, arg_set *a, bool is_epilogue,
|
||||
desc = FIELD_DP32(desc, MTEDESC, TBI, s->tbid);
|
||||
desc = FIELD_DP32(desc, MTEDESC, TCMA, s->tcma);
|
||||
desc = FIELD_DP32(desc, MTEDESC, WRITE, true);
|
||||
desc = FIELD_DP32(desc, MTEDESC, MTX, s->mtx);
|
||||
/* SIZEM1 and ALIGN we leave 0 (byte write) */
|
||||
}
|
||||
/* The helper function always needs the memidx even with MTE disabled */
|
||||
@@ -5014,11 +5018,13 @@ static bool do_CPY(DisasContext *s, arg_cpy *a, bool is_epilogue, CpyFn fn)
|
||||
if (s->mte_active[runpriv]) {
|
||||
rdesc = FIELD_DP32(rdesc, MTEDESC, TBI, s->tbid);
|
||||
rdesc = FIELD_DP32(rdesc, MTEDESC, TCMA, s->tcma);
|
||||
rdesc = FIELD_DP32(rdesc, MTEDESC, MTX, s->mtx);
|
||||
}
|
||||
if (s->mte_active[wunpriv]) {
|
||||
wdesc = FIELD_DP32(wdesc, MTEDESC, TBI, s->tbid);
|
||||
wdesc = FIELD_DP32(wdesc, MTEDESC, TCMA, s->tcma);
|
||||
wdesc = FIELD_DP32(wdesc, MTEDESC, WRITE, true);
|
||||
wdesc = FIELD_DP32(wdesc, MTEDESC, MTX, s->mtx);
|
||||
}
|
||||
/* The helper function needs these parts of the descriptor regardless */
|
||||
rdesc = FIELD_DP32(rdesc, MTEDESC, MIDX, rmemidx);
|
||||
@@ -10809,6 +10815,7 @@ static void aarch64_tr_init_disas_context(DisasContextBase *dcbase,
|
||||
dc->mte_active[1] = EX_TBFLAG_A64(tb_flags, MTE0_ACTIVE);
|
||||
dc->mte_store_only[0] = EX_TBFLAG_A64(tb_flags, MTE_STORE_ONLY);
|
||||
dc->mte_store_only[1] = EX_TBFLAG_A64(tb_flags, MTE0_STORE_ONLY);
|
||||
dc->mtx = EX_TBFLAG_A64(tb_flags, MTX);
|
||||
dc->pstate_sm = EX_TBFLAG_A64(tb_flags, PSTATE_SM);
|
||||
dc->pstate_za = EX_TBFLAG_A64(tb_flags, PSTATE_ZA);
|
||||
dc->sme_trap_nonstreaming = EX_TBFLAG_A64(tb_flags, SME_TRAP_NONSTREAMING);
|
||||
|
||||
@@ -82,6 +82,7 @@ typedef struct DisasContext {
|
||||
uint8_t tbii; /* TBI1|TBI0 for insns */
|
||||
uint8_t tbid; /* TBI1|TBI0 for data */
|
||||
uint8_t tcma; /* TCMA1|TCMA0 for MTE */
|
||||
uint8_t mtx; /* MTX1|MTX0 for MTE */
|
||||
bool ns; /* Use non-secure CPREG bank on access */
|
||||
int fp_excp_el; /* FP exception EL or 0 if enabled */
|
||||
int sve_excp_el; /* SVE exception EL or 0 if enabled */
|
||||
|
||||
Reference in New Issue
Block a user