[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 01/24] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA
From: |
Richard Henderson |
Subject: |
[PATCH v4 01/24] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA |
Date: |
Mon, 10 Oct 2022 20:18:48 -0700 |
Copy attrs and shareability, into the TLB. This will eventually
be used by S1_ptw_translate to report stage1 translation failures,
and by do_ats_write to fill in PAR_EL1.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu-param.h | 12 ++++++++++++
target/arm/tlb_helper.c | 3 +++
2 files changed, 15 insertions(+)
diff --git a/target/arm/cpu-param.h b/target/arm/cpu-param.h
index 08681828ac..38347b0d20 100644
--- a/target/arm/cpu-param.h
+++ b/target/arm/cpu-param.h
@@ -30,6 +30,18 @@
*/
# define TARGET_PAGE_BITS_VARY
# define TARGET_PAGE_BITS_MIN 10
+
+/*
+ * Cache the attrs and shareability fields from the page table entry.
+ *
+ * For ARMMMUIdx_Stage2*, pte_attrs is the S2 descriptor bits [5:2].
+ * Otherwise, pte_attrs is the same as the MAIR_EL1 8-bit format.
+ * For shareability, as in the SH field of the VMSAv8-64 PTEs.
+ */
+# define TARGET_PAGE_ENTRY_EXTRA \
+ uint8_t pte_attrs; \
+ uint8_t shareability;
+
#endif
#define NB_MMU_MODES 8
diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c
index 49601394ec..353edbeb1d 100644
--- a/target/arm/tlb_helper.c
+++ b/target/arm/tlb_helper.c
@@ -236,6 +236,9 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
arm_tlb_mte_tagged(&res.f.attrs) = true;
}
+ res.f.pte_attrs = res.cacheattrs.attrs;
+ res.f.shareability = res.cacheattrs.shareability;
+
tlb_set_page_full(cs, mmu_idx, address, &res.f);
return true;
} else if (probe) {
--
2.34.1
- [PATCH v4 06/24] target/arm: Restrict tlb flush from vttbr_write to vmid change, (continued)
- [PATCH v4 06/24] target/arm: Restrict tlb flush from vttbr_write to vmid change, Richard Henderson, 2022/10/10
- [PATCH v4 02/24] target/arm: Use probe_access_full for MTE, Richard Henderson, 2022/10/10
- [PATCH v4 12/24] target/arm: Use bool consistently for get_phys_addr subroutines, Richard Henderson, 2022/10/10
- [PATCH v4 13/24] target/arm: Add ptw_idx to S1Translate, Richard Henderson, 2022/10/10
- [PATCH v4 11/24] target/arm: Split out get_phys_addr_twostage, Richard Henderson, 2022/10/10
- [PATCH v4 07/24] target/arm: Split out S1Translate type, Richard Henderson, 2022/10/10
- [PATCH v4 01/24] target/arm: Enable TARGET_PAGE_ENTRY_EXTRA,
Richard Henderson <=
- [PATCH v4 14/24] target/arm: Add isar predicates for FEAT_HAFDBS, Richard Henderson, 2022/10/10
- [PATCH v4 18/24] target/arm: Remove loop from get_phys_addr_lpae, Richard Henderson, 2022/10/10
- [PATCH v4 19/24] target/arm: Fix fault reporting in get_phys_addr_lpae, Richard Henderson, 2022/10/10
- [PATCH v4 09/24] target/arm: Move be test for regime into S1TranslateResult, Richard Henderson, 2022/10/10
- [PATCH v4 10/24] target/arm: Use softmmu tlbs for page table walking, Richard Henderson, 2022/10/10
- [PATCH v4 16/24] target/arm: Move S1_ptw_translate outside arm_ld[lq]_ptw, Richard Henderson, 2022/10/10
- [PATCH v4 17/24] target/arm: Add ARMFault_UnsuppAtomicUpdate, Richard Henderson, 2022/10/10
- [PATCH v4 08/24] target/arm: Plumb debug into S1Translate, Richard Henderson, 2022/10/10
- [PATCH v4 20/24] target/arm: Don't shift attrs in get_phys_addr_lpae, Richard Henderson, 2022/10/10
- [PATCH v4 15/24] target/arm: Extract HA and HD in aa64_va_parameters, Richard Henderson, 2022/10/10