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

[xen staging-4.18] x86/mm: ensure L2 is always freed if empty



commit 84f5440be5e8555cc2820d0a99572e956737f1d0
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Nov 25 12:19:08 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 25 12:19:08 2024 +0100

    x86/mm: ensure L2 is always freed if empty
    
    The current logic in modify_xen_mappings() allows for fully empty L2 tables 
to
    not be freed and unhooked from the parent L3 if the last L2 slot is not
    populated.
    
    Ensure that even when an L2 slot is empty the logic to check whether the 
whole
    L2 can be removed is not skipped.
    
    Fixes: 4376c05c3113 ('x86-64: use 1GB pages in 1:1 mapping if available')
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 41c80496084aa3601230e01c3bc579a0a6d8359a
    master date: 2024-11-14 16:13:10 +0100
---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ecd3322868..2f0e586463 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5711,7 +5711,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, 
unsigned int nf)
 
             v += 1UL << L2_PAGETABLE_SHIFT;
             v &= ~((1UL << L2_PAGETABLE_SHIFT) - 1);
-            continue;
+            goto check_l3;
         }
 
         if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18



 


Rackspace

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