]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
npt/shadow: allow getting foreign page table entries
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 27 Feb 2019 11:09:05 +0000 (12:09 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 28 Feb 2019 17:36:43 +0000 (17:36 +0000)
Current npt and shadow code to get an entry will always return
INVALID_MFN for foreign entries. Allow to return the entry mfn for
foreign entries, like it's done for grant table entries.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m-pt.c

index e62bafcfb7c28376cef8984646bfbf9faf2d4d6a..cafc9f299bc3b6bd8c4e10227533fd34671beb7f 100644 (file)
@@ -903,8 +903,8 @@ pod_retry_l1:
     *t = p2m_recalc_type(recalc || _needs_recalc(flags), l1t, p2m, gfn);
     unmap_domain_page(l1e);
 
-    ASSERT(mfn_valid(mfn) || !p2m_is_ram(*t) || p2m_is_paging(*t));
-    return (p2m_is_valid(*t) || p2m_is_grant(*t)) ? mfn : INVALID_MFN;
+    ASSERT(mfn_valid(mfn) || !p2m_is_any_ram(*t) || p2m_is_paging(*t));
+    return (p2m_is_valid(*t) || p2m_is_any_ram(*t)) ? mfn : INVALID_MFN;
 }
 
 static void p2m_pt_change_entry_type_global(struct p2m_domain *p2m,