]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86 / p2m: replace page_list check in p2m_alloc_table...
authorPaul Durrant <paul@xen.org>
Tue, 10 Mar 2020 16:06:09 +0000 (17:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Mar 2020 16:06:09 +0000 (17:06 +0100)
... with a check of domain_tot_pages().

The check of page_list prevents the prior allocation of PGC_extra pages,
whereas what the code is trying to verify is that the toolstack has not
already RAM for the domain.

Signed-off-by: Paul Durrant <paul@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/p2m.c

index 3719deae776d7950224b9717eccee0cacaebcffd..9f51370327fc25b47595c058c750d27f9bd403d2 100644 (file)
@@ -695,8 +695,7 @@ int p2m_alloc_table(struct p2m_domain *p2m)
 
     p2m_lock(p2m);
 
-    if ( p2m_is_hostp2m(p2m)
-         && !page_list_empty(&d->page_list) )
+    if ( p2m_is_hostp2m(p2m) && domain_tot_pages(d) )
     {
         P2M_ERROR("dom %d already has memory allocated\n", d->domain_id);
         p2m_unlock(p2m);