[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging-4.13] x86/mm: account for PGT_pae_xen_l2 in recently added assertion



commit 1575075b2e3ac93e9bb2271f4c26a2fb7d947ade
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Jun 10 10:31:23 2022 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Jun 10 10:31:23 2022 +0200

    x86/mm: account for PGT_pae_xen_l2 in recently added assertion
    
    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@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: c2095ac76be0f4a1940346c9ffb49fb967345060
    master date: 2022-06-10 10:21:06 +0200
---
 xen/arch/x86/mm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index f5eeddce58..12531d3bff 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3004,7 +3004,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) )
             {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.13



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.