]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/mm: ensure L4 idle_pg_table is not modified past boot smap-idle-pg gitlab/smap-idle-pg
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>
Wed, 3 Jul 2024 09:39:49 +0000 (11:39 +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>
xen/arch/x86/mm.c

index 648d6dd475baa00b716ceda569f95e5469c38628..d394b7b4f112b1737f1c834bba97422df9cf9cae 100644 (file)
@@ -5021,6 +5021,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);