target/arm: Add is_secure parameter to pmsav7_use_background_region
Remove the use of regime_is_secure from pmsav7_use_background_region, using the new parameter instead. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220822152741.1617527-17-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
be0ca9485d
commit
1a469cf78d
|
@ -1489,7 +1489,7 @@ static bool m_is_system_region(CPUARMState *env, uint32_t address)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx,
|
static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx,
|
||||||
bool is_user)
|
bool is_secure, bool is_user)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Return true if we should use the default memory map as a
|
* Return true if we should use the default memory map as a
|
||||||
|
@ -1502,8 +1502,7 @@ static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arm_feature(env, ARM_FEATURE_M)) {
|
if (arm_feature(env, ARM_FEATURE_M)) {
|
||||||
return env->v7m.mpu_ctrl[regime_is_secure(env, mmu_idx)]
|
return env->v7m.mpu_ctrl[is_secure] & R_V7M_MPU_CTRL_PRIVDEFENA_MASK;
|
||||||
& R_V7M_MPU_CTRL_PRIVDEFENA_MASK;
|
|
||||||
} else {
|
} else {
|
||||||
return regime_sctlr(env, mmu_idx) & SCTLR_BR;
|
return regime_sctlr(env, mmu_idx) & SCTLR_BR;
|
||||||
}
|
}
|
||||||
|
@ -1516,6 +1515,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
||||||
{
|
{
|
||||||
ARMCPU *cpu = env_archcpu(env);
|
ARMCPU *cpu = env_archcpu(env);
|
||||||
int n;
|
int n;
|
||||||
|
bool secure = regime_is_secure(env, mmu_idx);
|
||||||
bool is_user = regime_is_user(env, mmu_idx);
|
bool is_user = regime_is_user(env, mmu_idx);
|
||||||
|
|
||||||
result->phys = address;
|
result->phys = address;
|
||||||
|
@ -1618,7 +1618,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == -1) { /* no hits */
|
if (n == -1) { /* no hits */
|
||||||
if (!pmsav7_use_background_region(cpu, mmu_idx, is_user)) {
|
if (!pmsav7_use_background_region(cpu, mmu_idx, secure, is_user)) {
|
||||||
/* background fault */
|
/* background fault */
|
||||||
fi->type = ARMFault_Background;
|
fi->type = ARMFault_Background;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1739,7 +1739,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
|
||||||
} else if (m_is_ppb_region(env, address)) {
|
} else if (m_is_ppb_region(env, address)) {
|
||||||
hit = true;
|
hit = true;
|
||||||
} else {
|
} else {
|
||||||
if (pmsav7_use_background_region(cpu, mmu_idx, is_user)) {
|
if (pmsav7_use_background_region(cpu, mmu_idx, secure, is_user)) {
|
||||||
hit = true;
|
hit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue