target/arm: Enable TARGET_PAGE_ENTRY_EXTRA
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 11 Oct 2022 03:18:48 +0000 (20:18 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 20 Oct 2022 10:27:49 +0000 (11:27 +0100)
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>
Message-id: 20221011031911.2408754-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/cpu-param.h
target/arm/tlb_helper.c

index 08681828ac4151f4274747579953dcc3ce3fb2a9..38347b0d2080e5adf3ac2d41f20b72f65385d7eb 100644 (file)
  */
 # 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
index 49601394ec1cf935baa8a045adc59e7fbaac51d3..353edbeb1de2a9b448544b0aeb17cb15c8fdaf3c 100644 (file)
@@ -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) {