WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [LINUX] Extend physical mapping to maxmem instead of mem
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Nov 2006 17:00:39 +0000
Delivery-date: Fri, 10 Nov 2006 09:00:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [LINUX] Extend physical mapping to maxmem instead of mem, Xen patchbot-unstable <=