[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 05/12] target/arm: Cache the GP bit for a page in
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v2 05/12] target/arm: Cache the GP bit for a page in MemTxAttrs |
Date: |
Mon, 28 Jan 2019 14:31:11 -0800 |
Caching the bit means that we will not have to re-walk the
page tables to look up the bit during translation.
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/helper.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 6efe88a157..70277222da 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10457,6 +10457,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.
@@ -10629,6 +10630,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;
@@ -10674,6 +10676,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) {
--
2.17.2
- [Qemu-devel] [PATCH v2 00/12] target/arm: Implement ARMv8.5-BTI, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 09/12] target/arm: Add x-guarded-pages cpu property for user-only, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 05/12] target/arm: Cache the GP bit for a page in MemTxAttrs,
Richard Henderson <=
- [Qemu-devel] [PATCH v2 01/12] target/arm: Introduce isar_feature_aa64_bti, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 08/12] target/arm: Set btype for indirect branches, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 04/12] exec: Add target-specific tlb bits to MemTxAttrs, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 12/12] tests/tcg/aarch64: Add bti smoke test, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 10/12] target/arm: Enable BTI for -cpu max, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 06/12] target/arm: Default handling of BTYPE during translation, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 07/12] target/arm: Reset btype for direct branches, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 02/12] target/arm: Add PSTATE.BTYPE, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 11/12] linux-user/aarch64: Reset btype for syscalls and signals, Richard Henderson, 2019/01/28
- [Qemu-devel] [PATCH v2 03/12] target/arm: Add BT and BTYPE to tb->flags, Richard Henderson, 2019/01/28