]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
arm: implement flush_tlb_all_local and flush_tlb_local
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 1 Jun 2012 09:20:34 +0000 (10:20 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 1 Jun 2012 09:20:34 +0000 (10:20 +0100)
Call flush_tlb_all_local from create_p2m_entries after removing a page
from the p2m.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/p2m.c
xen/include/asm-arm/flushtlb.h

index 4c94ef074a3441af1e569558d390edfbf3dbfa5e..051a0e89ddf34aa9cb2066cf21e948228a96a368 100644 (file)
@@ -3,6 +3,7 @@
 #include <xen/lib.h>
 #include <xen/errno.h>
 #include <xen/domain_page.h>
+#include <asm/flushtlb.h>
 
 void p2m_load_VTTBR(struct domain *d)
 {
@@ -123,6 +124,7 @@ static int create_p2m_entries(struct domain *d,
             /* p2m entry already present */
             free_domheap_page(
                     mfn_to_page(third[third_table_offset(addr)].p2m.base));
+            flush_tlb_all_local();
         }
 
         /* Allocate a new RAM page and attach */
index c8486fc4a76f0640918453c3484d10a762a3587a..210abfa386a62386258f955533ba1456825e971d 100644 (file)
@@ -14,8 +14,27 @@ do {                                                                    \
 
 #define tlbflush_current_time()                 (0)
 
-/* Flush local TLBs */
-void flush_tlb_local(void);
+/* 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();
+}
 
 /* Flush specified CPUs' TLBs */
 void flush_tlb_mask(const cpumask_t *mask);