aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-12-06 14:19:15 +0100
committerJan Beulich <jbeulich@suse.com>2012-12-06 14:19:15 +0100
commit8e4addea279da7430d80514828f49013979117e6 (patch)
tree23cc9a1ba61b187d340730b5dff80f8480a13e4e /xen/common/memory.c
parent16684ba0385590983b6145687b13a29956a2c8a6 (diff)
downloadxen-8e4addea279da7430d80514828f49013979117e6.tar.gz
xen-8e4addea279da7430d80514828f49013979117e6.tar.bz2
xen-8e4addea279da7430d80514828f49013979117e6.zip
memop: adjust error checking in populate_physmap()
Checking that multi-page allocations are permitted is unnecessary for PoD population operations. Instead, the (loop invariant) check added for addressing XSA-31 can be moved here. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index a076f81afe..a88348f802 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -99,7 +99,8 @@ static void populate_physmap(struct memop_args *a)
a->nr_extents-1) )
return;
- if ( !multipage_allocation_permitted(current->domain, a->extent_order) )
+ if ( a->memflags & MEMF_populate_on_demand ? a->extent_order > MAX_ORDER :
+ !multipage_allocation_permitted(current->domain, a->extent_order) )
return;
for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -115,8 +116,7 @@ static void populate_physmap(struct memop_args *a)
if ( a->memflags & MEMF_populate_on_demand )
{
- if ( a->extent_order > MAX_ORDER ||
- guest_physmap_mark_populate_on_demand(d, gpfn,
+ if ( guest_physmap_mark_populate_on_demand(d, gpfn,
a->extent_order) < 0 )
goto out;
}