aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-arm/arm32
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-02-22 08:57:50 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-02-22 12:14:51 +0000
commit1024642c62062dd8e12037ffaab2ed9754d74b35 (patch)
treeb87d3d9a8dc14406d3c7aa265460ad43ff9d304d /xen/include/asm-arm/arm32
parent5d7331690e317c3c926d0a9592f9d2840a1022d9 (diff)
downloadxen-1024642c62062dd8e12037ffaab2ed9754d74b35.tar.gz
xen-1024642c62062dd8e12037ffaab2ed9754d74b35.tar.bz2
xen-1024642c62062dd8e12037ffaab2ed9754d74b35.zip
xen: arm64: PTE handling
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'xen/include/asm-arm/arm32')
-rw-r--r--xen/include/asm-arm/arm32/page.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 073b8d17fa..a384f04ac1 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.