mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 10:06:55 +00:00
target/arm: Cache the GP bit for a page in MemTxAttrs
Caching the bit means that we will not have to re-walk the page tables to look up the bit during translation. Backports commit 1bafc2ba7e6bfe89fff3503fdac8db39c973de48 from qemu
This commit is contained in:
parent
9c2a5963d0
commit
d594b2047f
|
@ -9679,6 +9679,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
|||
bool ttbr1_valid;
|
||||
uint64_t descaddrmask;
|
||||
bool aarch64 = arm_el_is_aa64(env, el);
|
||||
bool guarded = false;
|
||||
|
||||
/* TODO:
|
||||
* This code does not handle the different format TCR for VTCR_EL2.
|
||||
|
@ -9859,6 +9860,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
|||
}
|
||||
/* Merge in attributes from table descriptors */
|
||||
attrs |= nstable << 3; /* NS */
|
||||
guarded = extract64(descriptor, 50, 1); /* GP */
|
||||
if (param.hpd) {
|
||||
/* HPD disables all the table attributes except NSTable. */
|
||||
break;
|
||||
|
@ -9904,6 +9906,10 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
|
|||
*/
|
||||
txattrs->secure = false;
|
||||
}
|
||||
/* When in aarch64 mode, and BTI is enabled, remember GP in the IOTLB. */
|
||||
if (aarch64 && guarded && cpu_isar_feature(aa64_bti, cpu)) {
|
||||
txattrs->target_tlb_bit0 = true;
|
||||
}
|
||||
|
||||
if (cacheattrs != NULL) {
|
||||
if (mmu_idx == ARMMMUIdx_S2NS) {
|
||||
|
|
Loading…
Reference in a new issue