|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH V2 11/46] xen: arm64: PTE handling
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
---
xen/include/asm-arm/arm32/page.h | 20 ++++++++++++++++++++
xen/include/asm-arm/arm64/page.h | 15 +++++++++++++++
xen/include/asm-arm/page.h | 20 --------------------
3 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 073b8d1..a384f04 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -3,6 +3,26 @@
#ifndef __ASSEMBLY__
+/* Write a pagetable entry.
+ *
+ * If the table entry is changing a text mapping, it is responsibility
+ * of the caller to issue an ISB after write_pte.
+ */
+static inline void write_pte(lpae_t *p, lpae_t pte)
+{
+ asm volatile (
+ /* Ensure any writes have completed with the old mappings. */
+ "dsb;"
+ /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
+ "strd %0, %H0, [%1];"
+ "dsb;"
+ /* Push this cacheline to the PoC so the rest of the system sees it. */
+ STORE_CP32(1, DCCMVAC)
+ /* Ensure that the data flush is completed before proceeding */
+ "dsb;"
+ : : "r" (pte.bits), "r" (p) : "memory");
+}
+
/*
* Flush all hypervisor mappings from the TLB and branch predictor.
* This is needed after changing Xen code mappings.
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 636fb63..99b7296 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -3,6 +3,21 @@
#ifndef __ASSEMBLY__
+/* Write a pagetable entry */
+static inline void write_pte(lpae_t *p, lpae_t pte)
+{
+ asm volatile (
+ /* Ensure any writes have completed with the old mappings. */
+ "dsb sy;"
+ "str %0, [%1];" /* Write the entry */
+ "dsb sy;"
+ /* Push this cacheline to the PoC so the rest of the system sees it. */
+ "dc cvac, %1;"
+ /* Ensure that the data flush is completed before proceeding */
+ "dsb sy;"
+ : : "r" (pte.bits), "r" (p) : "memory");
+}
+
/*
* Flush all hypervisor mappings from the TLB
* This is needed after changing Xen code mappings.
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 709a508..4e245a9 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -230,26 +230,6 @@ static inline lpae_t mfn_to_p2m_entry(unsigned long mfn,
unsigned int mattr)
return e;
}
-/* Write a pagetable entry.
- *
- * If the table entry is changing a text mapping, it is responsibility
- * of the caller to issue an ISB after write_pte.
- */
-static inline void write_pte(lpae_t *p, lpae_t pte)
-{
- asm volatile (
- /* Ensure any writes have completed with the old mappings. */
- "dsb;"
- /* Safely write the entry (STRD is atomic on CPUs that support LPAE) */
- "strd %0, %H0, [%1];"
- "dsb;"
- /* Push this cacheline to the PoC so the rest of the system sees it. */
- STORE_CP32(1, DCCMVAC)
- /* Ensure that the data flush is completed before proceeding */
- "dsb;"
- : : "r" (pte.bits), "r" (p) : "memory");
-}
-
#if defined(CONFIG_ARM_32)
# include <asm/arm32/page.h>
#elif defined(CONFIG_ARM_64)
--
1.7.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |