|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 11/45] xen: arm64: TLB flushes
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
xen/include/asm-arm/arm32/flushtlb.h | 34 ++++++++++++++++++++++++++++++++++
xen/include/asm-arm/arm64/flushtlb.h | 34 ++++++++++++++++++++++++++++++++++
xen/include/asm-arm/flushtlb.h | 34 ++++++++++------------------------
3 files changed, 78 insertions(+), 24 deletions(-)
create mode 100644 xen/include/asm-arm/arm32/flushtlb.h
create mode 100644 xen/include/asm-arm/arm64/flushtlb.h
diff --git a/xen/include/asm-arm/arm32/flushtlb.h
b/xen/include/asm-arm/arm32/flushtlb.h
new file mode 100644
index 0000000..3c2d5b6
--- /dev/null
+++ b/xen/include/asm-arm/arm32/flushtlb.h
@@ -0,0 +1,34 @@
+#ifndef __ASM_ARM_ARM32_FLUSHTLB_H__
+#define __ASM_ARM_ARM32_FLUSHTLB_H__
+
+/* Flush local TLBs, current VMID only */
+static inline void flush_tlb_local(void)
+{
+ dsb();
+
+ WRITE_CP32((uint32_t) 0, TLBIALLIS);
+
+ dsb();
+ isb();
+}
+
+/* Flush local TLBs, all VMIDs, non-hypervisor mode */
+static inline void flush_tlb_all_local(void)
+{
+ dsb();
+
+ WRITE_CP32((uint32_t) 0, TLBIALLNSNHIS);
+
+ dsb();
+ isb();
+}
+
+#endif /* __ASM_ARM_ARM32_FLUSHTLB_H__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/arm64/flushtlb.h
b/xen/include/asm-arm/arm64/flushtlb.h
new file mode 100644
index 0000000..b9eccba
--- /dev/null
+++ b/xen/include/asm-arm/arm64/flushtlb.h
@@ -0,0 +1,34 @@
+#ifndef __ASM_ARM_ARM64_FLUSHTLB_H__
+#define __ASM_ARM_ARM64_FLUSHTLB_H__
+
+/* Flush local TLBs, current VMID only */
+static inline void flush_tlb_local(void)
+{
+ asm volatile(
+ "dsb sy;"
+ "tlbi vmalle1;" /* ,is ??? */
+ "dsb sy;"
+ "isb;"
+ : : : "memory");
+}
+
+/* Flush local TLBs, all VMIDs, non-hypervisor mode */
+static inline void flush_tlb_all_local(void)
+{
+ asm volatile(
+ "dsb sy;"
+ "tlbi alle1;" /* ,is ??? */
+ "dsb sy;"
+ "isb;"
+ : : : "memory");
+}
+
+#endif /* __ASM_ARM_ARM64_FLUSHTLB_H__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/asm-arm/flushtlb.h b/xen/include/asm-arm/flushtlb.h
index 210abfa..e7ce27b 100644
--- a/xen/include/asm-arm/flushtlb.h
+++ b/xen/include/asm-arm/flushtlb.h
@@ -1,5 +1,5 @@
-#ifndef __FLUSHTLB_H__
-#define __FLUSHTLB_H__
+#ifndef __ASM_ARM_FLUSHTLB_H__
+#define __ASM_ARM_FLUSHTLB_H__
#include <xen/cpumask.h>
@@ -14,32 +14,18 @@ do {
\
#define tlbflush_current_time() (0)
-/* Flush local TLBs, current VMID only */
-static inline void flush_tlb_local(void)
-{
- dsb();
-
- WRITE_CP32((uint32_t) 0, TLBIALLIS);
-
- dsb();
- isb();
-}
-
-/* Flush local TLBs, all VMIDs, non-hypervisor mode */
-static inline void flush_tlb_all_local(void)
-{
- dsb();
-
- WRITE_CP32((uint32_t) 0, TLBIALLNSNHIS);
-
- dsb();
- isb();
-}
+#if defined(CONFIG_ARM_32)
+# include <asm/arm32/flushtlb.h>
+#elif defined(CONFIG_ARM_64)
+# include <asm/arm64/flushtlb.h>
+#else
+# error "unknown ARM variant"
+#endif
/* Flush specified CPUs' TLBs */
void flush_tlb_mask(const cpumask_t *mask);
-#endif /* __FLUSHTLB_H__ */
+#endif /* __ASM_ARM_FLUSHTLB_H__ */
/*
* Local variables:
* mode: C
--
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 |