#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.
#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.
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)