]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/mm: ensure L4 idle_pg_table is not modified past boot
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 25 Jun 2024 13:20:40 +0000 (15:20 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Thu, 27 Jun 2024 14:23:11 +0000 (16:23 +0200)
The idle_pg_table L4 is cloned to create all the other L4 Xen uses, and hence
it shouldn't be modofied once further L4 are created.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Could idle_pg_table also be placed in .data.ro_after_init also?

xen/arch/x86/mm.c

index 338266ab565253560df696d9548e6cdd6673deb7..a5e373e6273e6e24d1829f147c357bc90d4b9689 100644 (file)
@@ -5024,6 +5024,12 @@ static l3_pgentry_t *virt_to_xen_l3e(unsigned long v)
         mfn_t l3mfn;
         l3_pgentry_t *l3t = alloc_mapped_pagetable(&l3mfn);
 
+        /*
+         * dom0 is build at smp_boot, at which point we already create new L4s
+         * based on idle_pg_table.
+         */
+        BUG_ON(system_state >= SYS_STATE_smp_boot);
+
         if ( !l3t )
             return NULL;
         UNMAP_DOMAIN_PAGE(l3t);