aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-16 14:04:15 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-16 14:04:15 +0100
commit50f27130b5c3fe5f5f6c7faaf500f6fe5521b8b9 (patch)
tree02dd241ec2a33ea3c3dd7a3fb5ec2262311e0728 /xen/common/memory.c
parentcc0de53a903cd8399e6dce3c663545510c0c527a (diff)
downloadxen-50f27130b5c3fe5f5f6c7faaf500f6fe5521b8b9.tar.gz
xen-50f27130b5c3fe5f5f6c7faaf500f6fe5521b8b9.tar.bz2
xen-50f27130b5c3fe5f5f6c7faaf500f6fe5521b8b9.zip
x86: Allow guests to allocate up to 2MB (superpage) memory extents.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 0dd2b9282f..9717dc2be8 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -50,8 +50,7 @@ static void increase_reservation(struct memop_args *a)
a->nr_extents-1) )
return;
- if ( (a->extent_order != 0) &&
- !multipage_allocation_permitted(current->domain) )
+ if ( !multipage_allocation_permitted(current->domain, a->extent_order) )
return;
for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -96,8 +95,7 @@ static void populate_physmap(struct memop_args *a)
a->nr_extents-1) )
return;
- if ( (a->extent_order != 0) &&
- !multipage_allocation_permitted(current->domain) )
+ if ( !multipage_allocation_permitted(current->domain, a->extent_order) )
return;
for ( i = a->nr_done; i < a->nr_extents; i++ )
@@ -247,8 +245,10 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
}
/* Only privileged guests can allocate multi-page contiguous extents. */
- if ( ((exch.in.extent_order != 0) || (exch.out.extent_order != 0)) &&
- !multipage_allocation_permitted(current->domain) )
+ if ( !multipage_allocation_permitted(current->domain,
+ exch.in.extent_order) ||
+ !multipage_allocation_permitted(current->domain,
+ exch.out.extent_order) )
{
rc = -EPERM;
goto fail_early;