[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen staging] xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU



commit 00fc9004be169a065c10a5fb699e353e430190c2
Author:     Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Thu Jun 13 18:11:45 2019 +0100
Commit:     Julien Grall <julien.grall@xxxxxxx>
CommitDate: Wed Oct 16 12:28:26 2019 +0100

    xen/arm: mm: Clear boot pagetables before bringing-up each secondary CPU
    
    At the moment, boot pagetables are only cleared once at boot. This means
    when booting CPU2 (and onwards) then boot pagetables will not be
    cleared.
    
    To keep the interface exactly the same for all secondary CPU, the boot
    pagetables are now cleared before bringing-up each secondary CPU.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
    Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/arch/arm/mm.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index be23acfe26..01891293b8 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -707,8 +707,20 @@ void __init setup_pagetables(unsigned long 
boot_phys_offset)
 
     switch_ttbr(ttbr);
 
-    /* Clear the copy of the boot pagetables. Each secondary CPU
-     * rebuilds these itself (see head.S) */
+    xen_pt_enforce_wnx();
+
+#ifdef CONFIG_ARM_32
+    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
+    per_cpu(xen_dommap, 0) = cpu0_dommap;
+#endif
+}
+
+static void clear_boot_pagetables(void)
+{
+    /*
+     * Clear the copy of the boot pagetables. Each secondary CPU
+     * rebuilds these itself (see head.S).
+     */
     clear_table(boot_pgtable);
 #ifdef CONFIG_ARM_64
     clear_table(boot_first);
@@ -716,18 +728,13 @@ void __init setup_pagetables(unsigned long 
boot_phys_offset)
 #endif
     clear_table(boot_second);
     clear_table(boot_third);
-
-    xen_pt_enforce_wnx();
-
-#ifdef CONFIG_ARM_32
-    per_cpu(xen_pgtable, 0) = cpu0_pgtable;
-    per_cpu(xen_dommap, 0) = cpu0_dommap;
-#endif
 }
 
 #ifdef CONFIG_ARM_64
 int init_secondary_pagetables(int cpu)
 {
+    clear_boot_pagetables();
+
     /* Set init_ttbr for this CPU coming up. All CPus share a single setof
      * pagetables, but rewrite it each time for consistency with 32 bit. */
     init_ttbr = (uintptr_t) xen_pgtable + phys_offset;
@@ -770,6 +777,8 @@ int init_secondary_pagetables(int cpu)
     per_cpu(xen_pgtable, cpu) = first;
     per_cpu(xen_dommap, cpu) = domheap;
 
+    clear_boot_pagetables();
+
     /* Set init_ttbr for this CPU coming up */
     init_ttbr = __pa(first);
     clean_dcache(init_ttbr);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.