]> xenbits.xensource.com Git - xen.git/commitdiff
arm: new hook for late MMU setup on secondary CPUs
authorTim Deegan <tim@xen.org>
Tue, 13 Mar 2012 15:10:58 +0000 (15:10 +0000)
committerTim Deegan <tim@xen.org>
Tue, 13 Mar 2012 15:10:58 +0000 (15:10 +0000)
The boot CPU turns on W^X in setup_pagetables().  Do the same for other
CPUs after they boot.  If we go to per-CPU pagetables, this is where
that will happen.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/mm.c
xen/arch/arm/smpboot.c
xen/include/asm-arm/mm.h

index d85813fa4deedd424402da6b944ca8cf571e4a71..9fbf86c22615a5a6429985451e9d2fca06a6d4ad 100644 (file)
@@ -263,6 +263,13 @@ void __init setup_pagetables(unsigned long boot_phys_offset)
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
 }
 
+/* MMU setup for secondary CPUS (which already have paging enabled) */
+void __cpuinit mmu_init_secondary_cpu(void)
+{
+    /* From now on, no mapping may be both writable and executable. */
+    WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+}
+
 /* Create Xen's mappings of memory.
  * Base and virt must be 32MB aligned and size a multiple of 32MB. */
 static void __init create_mappings(unsigned long virt,
index b9b63c1fcb44901e2b39c2927a7313bdbc1336be..f369d70f4cae2a1e1b03e5f184b0dffbb9fa2a56 100644 (file)
@@ -76,6 +76,7 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
 
     dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
 
+    mmu_init_secondary_cpu();
     gic_init_secondary_cpu();
 
     set_current(idle_vcpu[cpuid]);
index 35b2a95fb7447fa03798bf3f8cf311d32b94fb0f..61228b1e6deb1e8d01fe6c413f58f82ed69934f1 100644 (file)
@@ -136,6 +136,8 @@ extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset);
+/* MMU setup for seccondary CPUS (which already have paging enabled) */
+extern void __cpuinit mmu_init_secondary_cpu(void);
 /* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);