mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/arm: Add prot_check parameter to do_ats_write
Separate protection check from access type, in preparation for skipping the protection check altogether. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20250830054128.448363-10-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
efebeec13d
commit
95901c43a8
@@ -24,14 +24,14 @@ static int par_el1_shareability(GetPhysAddrResult *res)
|
||||
}
|
||||
|
||||
static uint64_t do_ats_write(CPUARMState *env, uint64_t value,
|
||||
MMUAccessType access_type, ARMMMUIdx mmu_idx,
|
||||
unsigned prot_check, ARMMMUIdx mmu_idx,
|
||||
ARMSecuritySpace ss)
|
||||
{
|
||||
uint64_t par64;
|
||||
bool format64 = false;
|
||||
ARMMMUFaultInfo fi = {};
|
||||
GetPhysAddrResult res = {};
|
||||
bool ret = get_phys_addr_for_at(env, value, 1 << access_type,
|
||||
bool ret = get_phys_addr_for_at(env, value, prot_check,
|
||||
mmu_idx, ss, &res, &fi);
|
||||
|
||||
/*
|
||||
@@ -191,7 +191,7 @@ static uint64_t do_ats_write(CPUARMState *env, uint64_t value,
|
||||
|
||||
static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
|
||||
{
|
||||
MMUAccessType access_type = ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA_LOAD;
|
||||
unsigned access_perm = ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ;
|
||||
uint64_t par64;
|
||||
ARMMMUIdx mmu_idx;
|
||||
int el = arm_current_el(env);
|
||||
@@ -253,7 +253,7 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
|
||||
g_assert_not_reached();
|
||||
}
|
||||
|
||||
par64 = do_ats_write(env, value, access_type, mmu_idx, ss);
|
||||
par64 = do_ats_write(env, value, access_perm, mmu_idx, ss);
|
||||
|
||||
A32_BANKED_CURRENT_REG_SET(env, par, par64);
|
||||
}
|
||||
@@ -261,11 +261,11 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
|
||||
static void ats1h_write(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
uint64_t value)
|
||||
{
|
||||
MMUAccessType access_type = ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA_LOAD;
|
||||
unsigned access_perm = ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ;
|
||||
uint64_t par64;
|
||||
|
||||
/* There is no SecureEL2 for AArch32. */
|
||||
par64 = do_ats_write(env, value, access_type, ARMMMUIdx_E2,
|
||||
par64 = do_ats_write(env, value, access_perm, ARMMMUIdx_E2,
|
||||
ARMSS_NonSecure);
|
||||
|
||||
A32_BANKED_CURRENT_REG_SET(env, par, par64);
|
||||
@@ -309,7 +309,7 @@ static CPAccessResult at_s1e01_access(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
uint64_t value)
|
||||
{
|
||||
MMUAccessType access_type = ri->opc2 & 1 ? MMU_DATA_STORE : MMU_DATA_LOAD;
|
||||
unsigned access_perm = ri->opc2 & 1 ? PAGE_WRITE : PAGE_READ;
|
||||
ARMMMUIdx mmu_idx;
|
||||
uint64_t hcr_el2 = arm_hcr_el2_eff(env);
|
||||
bool regime_e20 = (hcr_el2 & (HCR_E2H | HCR_TGE)) == (HCR_E2H | HCR_TGE);
|
||||
@@ -352,7 +352,7 @@ static void ats_write64(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
}
|
||||
|
||||
ss = for_el3 ? arm_security_space(env) : arm_security_space_below_el3(env);
|
||||
env->cp15.par_el[1] = do_ats_write(env, value, access_type, mmu_idx, ss);
|
||||
env->cp15.par_el[1] = do_ats_write(env, value, access_perm, mmu_idx, ss);
|
||||
}
|
||||
|
||||
static CPAccessResult ats_access(CPUARMState *env, const ARMCPRegInfo *ri,
|
||||
|
||||
Reference in New Issue
Block a user