Skip to contentSkip to conversation

x86/PV: account for 32-bit Dom0 in mark_pv_pt_pages_rdonly()'s ASSERT()s

PATCH Superseded Jan Beulich 2 participants 3 messages Aug 20, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/PV: account for 32-bit Dom0 in mark_pv_pt_pages_rdonly()'s ASSERT()s

Clearly I neglected the special needs here, and also failed to test the change with a debug build of Xen.

Fixes 6b1ca51b1a91 ("x86/PV: assert page state in mark_pv_pt_pages_rdonly()")
xen/arch/x86/pv/dom0_build.c +1 -1
@@ -67,7 +67,7 @@ static __init void mark_pv_pt_pages_rdon
          */
         ASSERT((page->u.inuse.type_info & PGT_type_mask) >= PGT_l1_page_table);
         ASSERT((page->u.inuse.type_info & PGT_type_mask) <= PGT_root_page_table);
-        ASSERT(!(page->u.inuse.type_info & ~PGT_type_mask));
+        ASSERT(!(page->u.inuse.type_info & ~(PGT_type_mask | PGT_pae_xen_l2)));
 
         /* Read-only mapping + PGC_allocated + page-table page. */
         page->count_info         = PGC_allocated | 3;
#1 lore raw

xen/arch/x86/pv/dom0_build.c static __init void mark_pv_pt_pages_rdon · line 67

Quoted 10 lines · Jan Beulich

Clearly I neglected the special needs here, and also failed to test the change with a debug build of Xen.

Fixes 6b1ca51b1a91 ("x86/PV: assert page state in mark_pv_pt_pages_rdonly()")
xen/arch/x86/pv/dom0_build.c +0 -0
@@ -67,7 +67,7 @@ static __init void mark_pv_pt_pages_rdon
          */

^ this comment needs adjusting too.

Presumably this is because PGT_pae_xen_l2 is logically part of the type?

~Andrew

Quoted 8 lines
xen/arch/x86/pv/dom0_build.c +1 -1
         ASSERT((page->u.inuse.type_info & PGT_type_mask) >= PGT_l1_page_table);
         ASSERT((page->u.inuse.type_info & PGT_type_mask) <= PGT_root_page_table);
-        ASSERT(!(page->u.inuse.type_info & ~PGT_type_mask));
+        ASSERT(!(page->u.inuse.type_info & ~(PGT_type_mask | PGT_pae_xen_l2)));
 
         /* Read-only mapping + PGC_allocated + page-table page. */
         page->count_info         = PGC_allocated | 3;
#2 lore raw
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich

Clearly I neglected the special needs here, and also failed to test the change with a debug build of Xen.

Fixes 6b1ca51b1a91 ("x86/PV: assert page state in mark_pv_pt_pages_rdonly()")
Quoted 6 lines

xen/arch/x86/pv/dom0_build.c static __init void mark_pv_pt_pages_rdon · line 67

Quoted 4 lines
xen/arch/x86/pv/dom0_build.c +0 -0
@@ -67,7 +67,7 @@ static __init void mark_pv_pt_pages_rdon
          */

^ this comment needs adjusting too.

I didn't precisely because ...

Quoted 1 line

Presumably this is because PGT_pae_xen_l2 is logically part of the type?

... I would have viewed it this way. But I'll send v2 in a minute.

Jan