]> xenbits.xensource.com Git - xen.git/commitdiff
xen: arm: flush TLB after overwriting 1:1 mapping in boot page tables
authorIan Campbell <ian.campbell@citrix.com>
Mon, 14 Jul 2014 16:39:10 +0000 (17:39 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jul 2014 12:38:09 +0000 (13:38 +0100)
Otherwise a stale TLB entry can shadow the fixmap/UART or DTB mapping

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S

index 8a6594a07daa941dd334b2f9fe15156d94ef6d2b..73b97cb557cedede7f9d988826a493e5a7eb8bab 100644 (file)
@@ -360,9 +360,20 @@ paging:
         ldr   r4, =BOOT_FDT_VIRT_START
         mov   r4, r4, lsr #(SECOND_SHIFT - 3)   /* Slot for BOOT_FDT_VIRT_START */
         strd  r2, r3, [r1, r4]       /* Map it in the early fdt slot */
-        dsb
 1:
 
+        /*
+         * Flush the TLB in case the 1:1 mapping happens to clash with
+         * the virtual addresses used by the fixmap or DTB.
+         */
+        dsb                          /* Ensure any page table updates made above
+                                      * have occurred. */
+
+        isb
+        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+        dsb                          /* Ensure completion of TLB flush */
+        isb
+
         PRINT("- Ready -\r\n")
 
         /* The boot CPU should go straight into C now */
index 2a135274591270a016f98f291b381bdf72f96350..7d531433884f0aefdcc04f2884792b43b5987dd6 100644 (file)
@@ -382,9 +382,20 @@ paging:
         ldr   x1, =BOOT_FDT_VIRT_START
         lsr   x1, x1, #(SECOND_SHIFT - 3)   /* x4 := Slot for BOOT_FDT_VIRT_START */
         str   x2, [x4, x1]           /* Map it in the early fdt slot */
-        dsb   sy
 1:
 
+        /*
+         * Flush the TLB in case the 1:1 mapping happens to clash with
+         * the virtual addresses used by the fixmap or DTB.
+         */
+        dsb   sy                     /* Ensure any page table updates made above
+                                      * have occurred. */
+
+        isb
+        tlbi  alle2
+        dsb   sy                     /* Ensure completion of TLB flush */
+        isb
+
         PRINT("- Ready -\r\n")
 
         /* The boot CPU should go straight into C now */