Skip to content
  • Roger Pau Monné's avatar
    xen/x86: remove foreign mappings from the p2m on teardown · 845a60b6
    Roger Pau Monné authored and Jan Beulich's avatar Jan Beulich committed
    
    
    Iterate over the p2m up to the maximum recorded gfn and remove any foreign
    mappings, in order to drop the underlying page references and thus don't keep
    extra page references if a domain is destroyed while still having foreign
    mappings on it's p2m.
    
    The logic is similar to the one used on Arm.
    
    Note that foreign mappings cannot be created by guests that have altp2m or
    nested HVM enabled, as p2ms different than the host one are not currently
    scrubbed when destroyed in order to drop references to any foreign maps.
    
    It's unclear whether the right solution is to take an extra reference when
    foreign maps are added to p2ms different than the host one, or just rely on the
    host p2m already having a reference.  The mapping being removed from the host
    p2m should cause it to be dropped on all domain p2ms.
    
    Signed-off-by: default avatarRoger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: default avatarJan Beulich <jbeulich@suse.com>
    Release-acked-by: default avatarOleksii Kurochko <oleksii.kurochko@gmail.com>
    845a60b6
To find the state of this project's repository at the time of any of these versions, check out the tags.