Jan Beulich
2012-Dec-06 12:54 UTC
[PATCH] 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> --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -99,7 +99,8 @@ static void populate_physmap(struct memo 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 memo 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; } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Keir Fraser
2012-Dec-06 13:04 UTC
Re: [PATCH] memop: adjust error checking in populate_physmap()
On 06/12/2012 12:54, "Jan Beulich" <JBeulich@suse.com> wrote:> 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>> --- a/xen/common/memory.c > +++ b/xen/common/memory.c > @@ -99,7 +99,8 @@ static void populate_physmap(struct memo > 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 memo > > 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; > } > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Seemingly Similar Threads
- [PATCH] xen/arm: Allow balooning working with 1:1 memory mapping
- alloc_heap_pages is low efficient with more CPUs
- [PATCH 2/4] hvm: NUMA guest: extend populate_physmap to use a node
- [PATCH 2/6] xen: add per-node bucks to page allocator
- Re: Issue with ARM: Network doesn't work in the guest