]> xenbits.xensource.com Git - xen.git/commit
x86/mm: ensure L2 is always freed if empty
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 31 Oct 2024 11:43:10 +0000 (12:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 31 Oct 2024 11:43:10 +0000 (12:43 +0100)
commita6dba2761e2ecaa7ffc3d3bb3c85685d232bbe68
tree7d13e68bc2f478f8420db14cfd698e1d9def55a2
parentc01855bec572bb81d3934e0d217dd9671a6b4e54
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@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c