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-devel

[Xen-devel] [PATCH] fix initialisation of physaddr_bitsize etc.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix initialisation of physaddr_bitsize etc.
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 7 Feb 2008 13:28:07 +0000
Delivery-date: Thu, 07 Feb 2008 05:30:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
In 64-bit hypervisors with 32-bit dom0, the dom0 domain builder only
initialises d->arch.physaddr_bitsize if it has the ELF tag which sets
virt_hv_start_low.  This causes memory allocation to fail very early.

The attached patch fixes this, using __HYPERVISOR_COMPAT_VIRT_START as
a default value for the elf tag.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 99b8ffe25088 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Mon Feb 04 13:57:01 2008 +0000
+++ b/xen/arch/x86/domain_build.c       Thu Feb 07 13:22:27 2008 +0000
@@ -349,8 +349,9 @@ int __init construct_dom0(
     if ( parms.pae == PAEKERN_extended_cr3 )
             set_bit(VMASST_TYPE_pae_extended_cr3, &d->vm_assist);
 
-    if ( UNSET_ADDR != parms.virt_hv_start_low && elf_32bit(&elf) )
-    {
+    if ( elf_32bit(&elf) )
+    {
+        uint64_t virt_hv_start_low;
 #if CONFIG_PAGING_LEVELS < 4
         unsigned long mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
 #else
@@ -358,8 +359,11 @@ int __init construct_dom0(
                              ? (1UL << L2_PAGETABLE_SHIFT) - 1
                              : (1UL << L4_PAGETABLE_SHIFT) - 1;
 #endif
-
-        value = (parms.virt_hv_start_low + mask) & ~mask;
+        virt_hv_start_low = parms.virt_hv_start_low;
+        if (virt_hv_start_low == UNSET_ADDR)
+            virt_hv_start_low = __HYPERVISOR_COMPAT_VIRT_START;
+
+        value = (virt_hv_start_low + mask) & ~mask;
 #ifdef CONFIG_COMPAT
         HYPERVISOR_COMPAT_VIRT_START(d) =
             max_t(unsigned int, m2p_compat_vstart, value);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix initialisation of physaddr_bitsize etc., Ian Jackson <=