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] tools: libxc: allow HVM firmware to be lo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Thu, 16 Jun 2011 11:11:44 +0100
Delivery-date: Thu, 16 Jun 2011 03:15:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306257845 -3600
# Node ID f62ef47cc5912deb2e3fa77b2b932373047c646b
# Parent  2b84aed6017584004cb7157792c9da15acb17000
tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment

Enables direct loading of e.g. seabios.elf.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 2b84aed60175 -r f62ef47cc591 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Tue May 24 18:22:23 2011 +0100
+++ b/tools/libxc/xc_hvm_build.c        Tue May 24 18:24:05 2011 +0100
@@ -88,7 +88,9 @@
     struct elf_binary *elf, uint32_t dom, unsigned long *parray)
 {
     privcmd_mmap_entry_t *entries = NULL;
-    size_t pages = (elf->pend - elf->pstart + PAGE_SIZE - 1) >> PAGE_SHIFT;
+    unsigned long pfn_start = elf->pstart >> PAGE_SHIFT;
+    unsigned long pfn_end = (elf->pend + PAGE_SIZE - 1) >> PAGE_SHIFT;
+    size_t pages = pfn_end - pfn_start;
     int i, rc = -1;
 
     /* Map address space for initial elf image. */
@@ -105,6 +107,8 @@
     if ( elf->dest == NULL )
         goto err;
 
+    elf->dest += elf->pstart & (PAGE_SIZE - 1);
+
     /* Load the initial elf image. */
     elf_load_binary(elf);
     rc = 0;
@@ -172,12 +176,6 @@
         goto error_out;
     }
 
-    if ( (elf.pstart & (PAGE_SIZE - 1)) != 0 )
-    {
-        PERROR("Guest OS must load to a page boundary.");
-        goto error_out;
-    }
-
     IPRINTF("VIRTUAL MEMORY ARRANGEMENT:\n"
             "  Loader:        %016"PRIx64"->%016"PRIx64"\n"
             "  TOTAL:         %016"PRIx64"->%016"PRIx64"\n"

_______________________________________________
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] tools: libxc: allow HVM firmware to be loaded at an arbitrary alignment, Xen patchbot-unstable <=