mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
target/arm: Remove unused env argument from regime_el
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20251008215613.300150-19-richard.henderson@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
committed by
Peter Maydell
parent
65ef0f2b33
commit
5dccad96b1
+1
-1
@@ -9391,7 +9391,7 @@ ARMVAParameters aa64_va_parameters(CPUARMState *env, uint64_t va,
|
||||
ARMGranuleSize gran;
|
||||
ARMCPU *cpu = env_archcpu(env);
|
||||
bool stage2 = regime_is_stage2(mmu_idx);
|
||||
int r_el = regime_el(env, mmu_idx);
|
||||
int r_el = regime_el(mmu_idx);
|
||||
|
||||
if (!regime_has_2_ranges(mmu_idx)) {
|
||||
select = 0;
|
||||
|
||||
@@ -1074,7 +1074,7 @@ static inline bool regime_is_stage2(ARMMMUIdx mmu_idx)
|
||||
}
|
||||
|
||||
/* Return the exception level which controls this address translation regime */
|
||||
static inline uint32_t regime_el(CPUARMState *env, ARMMMUIdx mmu_idx)
|
||||
static inline uint32_t regime_el(ARMMMUIdx mmu_idx)
|
||||
{
|
||||
switch (mmu_idx) {
|
||||
case ARMMMUIdx_E20_0:
|
||||
@@ -1128,7 +1128,7 @@ static inline bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx)
|
||||
/* Return the SCTLR value which controls this address translation regime */
|
||||
static inline uint64_t regime_sctlr(CPUARMState *env, ARMMMUIdx mmu_idx)
|
||||
{
|
||||
return env->cp15.sctlr_el[regime_el(env, mmu_idx)];
|
||||
return env->cp15.sctlr_el[regime_el(mmu_idx)];
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1160,13 +1160,13 @@ static inline uint64_t regime_tcr(CPUARMState *env, ARMMMUIdx mmu_idx)
|
||||
v |= env->cp15.vtcr_el2 & VTCR_SHARED_FIELD_MASK;
|
||||
return v;
|
||||
}
|
||||
return env->cp15.tcr_el[regime_el(env, mmu_idx)];
|
||||
return env->cp15.tcr_el[regime_el(mmu_idx)];
|
||||
}
|
||||
|
||||
/* Return true if the translation regime is using LPAE format page tables */
|
||||
static inline bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx)
|
||||
{
|
||||
int el = regime_el(env, mmu_idx);
|
||||
int el = regime_el(mmu_idx);
|
||||
if (el == 2 || arm_el_is_aa64(env, el)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+17
-17
@@ -235,9 +235,9 @@ static uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx, int ttbrn)
|
||||
return env->cp15.vsttbr_el2;
|
||||
}
|
||||
if (ttbrn == 0) {
|
||||
return env->cp15.ttbr0_el[regime_el(env, mmu_idx)];
|
||||
return env->cp15.ttbr0_el[regime_el(mmu_idx)];
|
||||
} else {
|
||||
return env->cp15.ttbr1_el[regime_el(env, mmu_idx)];
|
||||
return env->cp15.ttbr1_el[regime_el(mmu_idx)];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1059,7 +1059,7 @@ static bool get_phys_addr_v5(CPUARMState *env, S1Translate *ptw,
|
||||
}
|
||||
type = (desc & 3);
|
||||
domain = (desc >> 5) & 0x0f;
|
||||
if (regime_el(env, ptw->in_mmu_idx) == 1) {
|
||||
if (regime_el(ptw->in_mmu_idx) == 1) {
|
||||
dacr = env->cp15.dacr_ns;
|
||||
} else {
|
||||
dacr = env->cp15.dacr_s;
|
||||
@@ -1198,7 +1198,7 @@ static bool get_phys_addr_v6(CPUARMState *env, S1Translate *ptw,
|
||||
/* Page or Section. */
|
||||
domain = (desc >> 5) & 0x0f;
|
||||
}
|
||||
if (regime_el(env, mmu_idx) == 1) {
|
||||
if (regime_el(mmu_idx) == 1) {
|
||||
dacr = env->cp15.dacr_ns;
|
||||
} else {
|
||||
dacr = env->cp15.dacr_s;
|
||||
@@ -1489,7 +1489,7 @@ static int get_S1prot(CPUARMState *env, ARMMMUIdx mmu_idx, bool is_aa64,
|
||||
xn = pxn || (user_rw & PAGE_WRITE);
|
||||
}
|
||||
} else if (arm_feature(env, ARM_FEATURE_V7)) {
|
||||
switch (regime_el(env, mmu_idx)) {
|
||||
switch (regime_el(mmu_idx)) {
|
||||
case 1:
|
||||
case 3:
|
||||
if (is_user) {
|
||||
@@ -1545,7 +1545,7 @@ static int get_S1prot_indirect(CPUARMState *env, S1Translate *ptw,
|
||||
/* F */ 0, /* reserved */
|
||||
};
|
||||
|
||||
uint32_t el = regime_el(env, mmu_idx);
|
||||
uint32_t el = regime_el(mmu_idx);
|
||||
uint64_t pir = env->cp15.pir_el[el];
|
||||
uint64_t pire0 = 0;
|
||||
int perm;
|
||||
@@ -1620,7 +1620,7 @@ static ARMVAParameters aa32_va_parameters(CPUARMState *env, uint32_t va,
|
||||
ARMMMUIdx mmu_idx)
|
||||
{
|
||||
uint64_t tcr = regime_tcr(env, mmu_idx);
|
||||
uint32_t el = regime_el(env, mmu_idx);
|
||||
uint32_t el = regime_el(mmu_idx);
|
||||
int select, tsz;
|
||||
bool epd, hpd;
|
||||
|
||||
@@ -1846,7 +1846,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,
|
||||
int addrsize, inputsize, outputsize;
|
||||
uint64_t tcr = regime_tcr(env, mmu_idx);
|
||||
int ap, prot;
|
||||
uint32_t el = regime_el(env, mmu_idx);
|
||||
uint32_t el = regime_el(mmu_idx);
|
||||
uint64_t descaddrmask;
|
||||
bool aarch64 = arm_el_is_aa64(env, el);
|
||||
uint64_t descriptor, new_descriptor;
|
||||
@@ -2296,7 +2296,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,
|
||||
|
||||
/* Index into MAIR registers for cache attributes */
|
||||
attrindx = extract32(attrs, 2, 3);
|
||||
mair = env->cp15.mair_el[regime_el(env, mmu_idx)];
|
||||
mair = env->cp15.mair_el[regime_el(mmu_idx)];
|
||||
assert(attrindx <= 7);
|
||||
result->cacheattrs.is_s2_format = false;
|
||||
result->cacheattrs.attrs = extract64(mair, attrindx * 8, 8);
|
||||
@@ -2774,7 +2774,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,
|
||||
static uint32_t *regime_rbar(CPUARMState *env, ARMMMUIdx mmu_idx,
|
||||
uint32_t secure)
|
||||
{
|
||||
if (regime_el(env, mmu_idx) == 2) {
|
||||
if (regime_el(mmu_idx) == 2) {
|
||||
return env->pmsav8.hprbar;
|
||||
} else {
|
||||
return env->pmsav8.rbar[secure];
|
||||
@@ -2784,7 +2784,7 @@ static uint32_t *regime_rbar(CPUARMState *env, ARMMMUIdx mmu_idx,
|
||||
static uint32_t *regime_rlar(CPUARMState *env, ARMMMUIdx mmu_idx,
|
||||
uint32_t secure)
|
||||
{
|
||||
if (regime_el(env, mmu_idx) == 2) {
|
||||
if (regime_el(mmu_idx) == 2) {
|
||||
return env->pmsav8.hprlar;
|
||||
} else {
|
||||
return env->pmsav8.rlar[secure];
|
||||
@@ -2816,7 +2816,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
|
||||
uint32_t addr_page_limit = addr_page_base + (TARGET_PAGE_SIZE - 1);
|
||||
int region_counter;
|
||||
|
||||
if (regime_el(env, mmu_idx) == 2) {
|
||||
if (regime_el(mmu_idx) == 2) {
|
||||
region_counter = cpu->pmsav8r_hdregion;
|
||||
} else {
|
||||
region_counter = cpu->pmsav7_dregion;
|
||||
@@ -2942,7 +2942,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
|
||||
xn = 1;
|
||||
}
|
||||
|
||||
if (regime_el(env, mmu_idx) == 2) {
|
||||
if (regime_el(mmu_idx) == 2) {
|
||||
result->f.prot = simple_ap_to_rw_prot_is_user(ap,
|
||||
mmu_idx != ARMMMUIdx_E2);
|
||||
} else {
|
||||
@@ -2951,7 +2951,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
|
||||
|
||||
if (!arm_feature(env, ARM_FEATURE_M)) {
|
||||
uint8_t attrindx = extract32(matched_rlar, 1, 3);
|
||||
uint64_t mair = env->cp15.mair_el[regime_el(env, mmu_idx)];
|
||||
uint64_t mair = env->cp15.mair_el[regime_el(mmu_idx)];
|
||||
uint8_t sh = extract32(matched_rlar, 3, 2);
|
||||
|
||||
if (regime_sctlr(env, mmu_idx) & SCTLR_WXN &&
|
||||
@@ -2959,7 +2959,7 @@ bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,
|
||||
xn = 0x1;
|
||||
}
|
||||
|
||||
if ((regime_el(env, mmu_idx) == 1) &&
|
||||
if ((regime_el(mmu_idx) == 1) &&
|
||||
regime_sctlr(env, mmu_idx) & SCTLR_UWXN && ap == 0x1) {
|
||||
pxn = 0x1;
|
||||
}
|
||||
@@ -3444,7 +3444,7 @@ static bool get_phys_addr_disabled(CPUARMState *env,
|
||||
break;
|
||||
|
||||
default:
|
||||
r_el = regime_el(env, mmu_idx);
|
||||
r_el = regime_el(mmu_idx);
|
||||
if (arm_el_is_aa64(env, r_el)) {
|
||||
int pamax = arm_pamax(env_archcpu(env));
|
||||
uint64_t tcr = env->cp15.tcr_el[r_el];
|
||||
@@ -3697,7 +3697,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
|
||||
*/
|
||||
if (address < 0x02000000 && mmu_idx != ARMMMUIdx_Stage2
|
||||
&& !arm_feature(env, ARM_FEATURE_V8)) {
|
||||
if (regime_el(env, mmu_idx) == 3) {
|
||||
if (regime_el(mmu_idx) == 3) {
|
||||
address += env->cp15.fcseidr_s;
|
||||
} else {
|
||||
address += env->cp15.fcseidr_ns;
|
||||
|
||||
@@ -605,7 +605,7 @@ void mte_check_fail(CPUARMState *env, uint32_t desc,
|
||||
int el, reg_el, tcf;
|
||||
uint64_t sctlr;
|
||||
|
||||
reg_el = regime_el(env, arm_mmu_idx);
|
||||
reg_el = regime_el(arm_mmu_idx);
|
||||
sctlr = env->cp15.sctlr_el[reg_el];
|
||||
|
||||
switch (arm_mmu_idx) {
|
||||
|
||||
Reference in New Issue
Block a user