mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-19 08:17:39 +00:00
target/arm: Remove ttbr1_valid check from get_phys_addr_lpae
Now that aa64_va_parameters_both sets select based on the number of ranges in the regime, the ttbr1_valid check is redundant. Backports commit 03f27724dff15633911e68a3906c30f57938ea45 from qemu
This commit is contained in:
parent
f3fa39829d
commit
2cce7e0dd0
|
@ -10245,7 +10245,6 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
||||||
TCR *tcr = regime_tcr(env, mmu_idx);
|
TCR *tcr = regime_tcr(env, mmu_idx);
|
||||||
int ap, ns, xn, pxn;
|
int ap, ns, xn, pxn;
|
||||||
uint32_t el = regime_el(env, mmu_idx);
|
uint32_t el = regime_el(env, mmu_idx);
|
||||||
bool ttbr1_valid;
|
|
||||||
uint64_t descaddrmask;
|
uint64_t descaddrmask;
|
||||||
bool aarch64 = arm_el_is_aa64(env, el);
|
bool aarch64 = arm_el_is_aa64(env, el);
|
||||||
bool guarded = false;
|
bool guarded = false;
|
||||||
|
@ -10261,14 +10260,11 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
||||||
param = aa64_va_parameters(env, address, mmu_idx,
|
param = aa64_va_parameters(env, address, mmu_idx,
|
||||||
access_type != MMU_INST_FETCH);
|
access_type != MMU_INST_FETCH);
|
||||||
level = 0;
|
level = 0;
|
||||||
ttbr1_valid = regime_has_2_ranges(mmu_idx);
|
|
||||||
addrsize = 64 - 8 * param.tbi;
|
addrsize = 64 - 8 * param.tbi;
|
||||||
inputsize = 64 - param.tsz;
|
inputsize = 64 - param.tsz;
|
||||||
} else {
|
} else {
|
||||||
param = aa32_va_parameters(env, address, mmu_idx);
|
param = aa32_va_parameters(env, address, mmu_idx);
|
||||||
level = 1;
|
level = 1;
|
||||||
/* There is no TTBR1 for EL2 */
|
|
||||||
ttbr1_valid = (el != 2);
|
|
||||||
addrsize = (mmu_idx == ARMMMUIdx_Stage2 ? 40 : 32);
|
addrsize = (mmu_idx == ARMMMUIdx_Stage2 ? 40 : 32);
|
||||||
inputsize = addrsize - param.tsz;
|
inputsize = addrsize - param.tsz;
|
||||||
}
|
}
|
||||||
|
@ -10285,7 +10281,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
||||||
if (inputsize < addrsize) {
|
if (inputsize < addrsize) {
|
||||||
target_ulong top_bits = sextract64(address, inputsize,
|
target_ulong top_bits = sextract64(address, inputsize,
|
||||||
addrsize - inputsize);
|
addrsize - inputsize);
|
||||||
if (-top_bits != param.select || (param.select && !ttbr1_valid)) {
|
if (-top_bits != param.select) {
|
||||||
/* The gap between the two regions is a Translation fault */
|
/* The gap between the two regions is a Translation fault */
|
||||||
fault_type = ARMFault_Translation;
|
fault_type = ARMFault_Translation;
|
||||||
goto do_fault;
|
goto do_fault;
|
||||||
|
|
Loading…
Reference in a new issue