[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [LINUX] Extend physical mapping to maxmem instead of mem



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 32f7b40ace426d3acdf26c21c20cb6b4562d9f10
# Parent  5cdd4da17036cb5c5a9353a0d341c18279706c5e
[LINUX] Extend physical mapping to maxmem instead of mem

As currently physical mapping only reaches the initial reservation,
we're unable to balloon up to more than mem (even when maxmem > mem)
in any situation.

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c               |    9 
+++++++--
 linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h |    8 
+++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff -r 5cdd4da17036 -r 32f7b40ace42 
linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c        Fri Nov 10 
14:22:17 2006 +0000
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c        Fri Nov 10 
14:22:30 2006 +0000
@@ -583,15 +583,20 @@ void __init setup_memory_region(void)
         * the boot process we know we have plenty slack space.
         */
        struct e820entry map[E820MAX];
+       unsigned long arg = DOMID_SELF;
 
        memmap.nr_entries = E820MAX;
        set_xen_guest_handle(memmap.buffer, map);
 
        rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
-       if ( rc == -ENOSYS ) {
+       if (rc == -ENOSYS) {
                memmap.nr_entries = 1;
                map[0].addr = 0ULL;
-               map[0].size = xen_start_info->nr_pages << PAGE_SHIFT;
+               rc = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &arg);
+               if (rc < 0)
+                       map[0].size = xen_start_info->nr_pages << PAGE_SHIFT;
+               else
+                       map[0].size = rc << PAGE_SHIFT;
                /* 8MB slack (to balance backend allocations). */
                map[0].size += 8 << 20;
                map[0].type = E820_RAM;
diff -r 5cdd4da17036 -r 32f7b40ace42 
linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h  Fri Nov 
10 14:22:17 2006 +0000
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h  Fri Nov 
10 14:22:30 2006 +0000
@@ -13,6 +13,7 @@ static char * __init machine_specific_me
 {
        int rc;
        struct xen_memory_map memmap;
+       unsigned long arg = DOMID_SELF;
        /*
         * This is rather large for a stack variable but this early in
         * the boot process we know we have plenty slack space.
@@ -23,9 +24,14 @@ static char * __init machine_specific_me
        set_xen_guest_handle(memmap.buffer, map);
 
        rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap);
-       if ( rc == -ENOSYS ) {
+       if (rc == -ENOSYS) {
                memmap.nr_entries = 1;
                map[0].addr = 0ULL;
+               rc = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &arg);
+               if (rc < 0)
+                       map[0].size = PFN_PHYS(xen_start_info->nr_pages);
+               else
+                       map[0].size = PFN_PHYS(rc);
                map[0].size = PFN_PHYS(xen_start_info->nr_pages);
                /* 8MB slack (to balance backend allocations). */
                map[0].size += 8ULL << 20;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.