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] [LOADER] Remove check for VIRT_BASE existence: it's not

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [LOADER] Remove check for VIRT_BASE existence: it's not needed
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 21 May 2006 10:38:11 +0000
Delivery-date: Sun, 21 May 2006 03:39:37 -0700
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 4dcb93547710d1071e6d2e77c6d7b7890760fb4a
# Parent  d081a485f34bc074b56828e95b7c5a5c123c5c37
[LOADER] Remove check for VIRT_BASE existence: it's not needed
to prevent xend crashign (when Aravindh's latest patch is
applied) and breaks ia64. Also, ensure we set a reasonable
default for elf_paddr_offset.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 tools/libxc/xc_load_elf.c |   25 ++++++++++++++-----------
 xen/common/elf.c          |   14 +++++++++++---
 2 files changed, 25 insertions(+), 14 deletions(-)

diff -r d081a485f34b -r 4dcb93547710 tools/libxc/xc_load_elf.c
--- a/tools/libxc/xc_load_elf.c Sat May 20 16:25:28 2006 +0100
+++ b/tools/libxc/xc_load_elf.c Sun May 21 09:55:15 2006 +0100
@@ -148,14 +148,9 @@ static int parseelfimage(const char *ima
 
     dsi->xen_guest_string = guestinfo;
 
-    if ( (p = strstr(guestinfo, "VIRT_BASE=")) == NULL )
-    {
-        ERROR("Malformed ELF image. No VIRT_BASE specified");
-        return -EINVAL;
-    }
-
-    virt_base = strtoul(p+10, &p, 0);
-
+    virt_base = 0;
+    if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
+        virt_base = strtoul(p+10, &p, 0);
     dsi->elf_paddr_offset = virt_base;
     if ( (p = strstr(guestinfo, "ELF_PADDR_OFFSET=")) != NULL )
         dsi->elf_paddr_offset = strtoul(p+17, &p, 0);
@@ -172,10 +167,18 @@ static int parseelfimage(const char *ima
             kernend = vaddr + phdr->p_memsz;
     }
 
-    if ( virt_base )
-        dsi->v_start = virt_base;
-    else
+    dsi->v_start = virt_base;
+    if ( dsi->v_start == 0 )
+    {
+        /*
+         * Legacy compatibility and images with no __xen_guest section:
+         * assume header addresses are virtual addresses, and that 
+         * guest memory should be mapped starting at kernel load address.
+         */
         dsi->v_start = kernstart;
+        if ( dsi->elf_paddr_offset == 0 )
+            dsi->elf_paddr_offset = dsi->v_start;
+    }
 
     dsi->v_kernentry = ehdr->e_entry;
     if ( (p = strstr(guestinfo, "VIRT_ENTRY=")) != NULL )
diff -r d081a485f34b -r 4dcb93547710 xen/common/elf.c
--- a/xen/common/elf.c  Sat May 20 16:25:28 2006 +0100
+++ b/xen/common/elf.c  Sun May 21 09:55:15 2006 +0100
@@ -103,10 +103,18 @@ int parseelfimage(struct domain_setup_in
             kernend = vaddr + phdr->p_memsz;
     }
 
-    if ( virt_base )
-        dsi->v_start = virt_base;
-    else
+    dsi->v_start = virt_base;
+    if ( dsi->v_start == 0 )
+    {
+        /*
+         * Legacy compatibility and images with no __xen_guest section:
+         * assume header addresses are virtual addresses, and that 
+         * guest memory should be mapped starting at kernel load address.
+         */
         dsi->v_start = kernstart;
+        if ( dsi->elf_paddr_offset == 0 )
+            dsi->elf_paddr_offset = dsi->v_start;
+    }
 
     dsi->v_kernentry = ehdr->e_entry;
     if ( (p = strstr(guestinfo, "VIRT_ENTRY=")) != NULL )

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [LOADER] Remove check for VIRT_BASE existence: it's not needed, Xen patchbot-unstable <=