]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: account for PGT_pae_xen_l2 in recently added assertion
authorJan Beulich <jbeulich@suse.com>
Fri, 10 Jun 2022 08:30:44 +0000 (10:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jun 2022 08:30:44 +0000 (10:30 +0200)
While PGT_pae_xen_l2 will be zapped once the type refcount of an L2 page
reaches zero, it'll be retained as long as the type refcount is non-
zero. Hence any checking against the requested type needs to either zap
the bit from the type or include it in the used mask.

Fixes: 9186e96b199e ("x86/pv: Clean up _get_page_type()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: c2095ac76be0f4a1940346c9ffb49fb967345060
master date: 2022-06-10 10:21:06 +0200

xen/arch/x86/mm.c

index 4d6b04c1cf31b5f1413a3225c044851df699bc98..3b72d9e8d322582d759db238d88f830825f931dc 100644 (file)
@@ -2918,7 +2918,8 @@ static int _get_page_type(struct page_info *page, unsigned long type,
              * The page is in one of two states (depending on PGT_partial),
              * and should have exactly one reference.
              */
-            ASSERT((x & (PGT_type_mask | PGT_count_mask)) == (type | 1));
+            ASSERT((x & (PGT_type_mask | PGT_pae_xen_l2 | PGT_count_mask)) ==
+                   (type | 1));
 
             if ( !(x & PGT_partial) )
             {