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

xen-devel

[Top] [All Lists]

[Xen-devel] better fix for checking if bzImage

To: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] better fix for checking if bzImage
From: "Cihula, Joseph" <joseph.cihula@xxxxxxxxx>
Date: 2009年1月30日 01:17:30 -0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: 2009年1月30日 01:18:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmCu5Or/lGi1bdJRuqk2p4CL+fgpg==
Thread-topic: better fix for checking if bzImage
The access fault when trying to calculate bzimage_headroom() is back when I use 
a new version of tboot that has some additional code added to it.
Here is a patch that I think more properly fixes the issue (and fixes it for my 
new, larger tboot) and should prevent it from recurring:
diff -r 916ca93a8658 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Thu Jan 29 23:40:37 2009 +0000
+++ b/xen/arch/x86/setup.c Fri Jan 30 00:09:27 2009 -0800
@@ -417,7 +417,7 @@ void __init __start_xen(unsigned long mb
 unsigned int initrdidx = 1;
 multiboot_info_t *mbi = __va(mbi_p);
 module_t *mod = (module_t *)__va(mbi->mods_addr);
- unsigned long nr_pages, modules_length, modules_headroom = -1;
+ unsigned long nr_pages, modules_length, modules_headroom;
 unsigned long allocator_bitmap_end;
 int i, e820_warn = 0, bytes = 0;
 struct ns16550_defaults ns16550 = {
@@ -618,6 +618,12 @@ void __init __start_xen(unsigned long mb
 */
 modules_length = mod[mbi->mods_count-1].mod_end - mod[0].mod_start;
+ /* ensure mod[0] is mapped before parsing */
+ bootstrap_map(mod[0].mod_start, mod[0].mod_end);
+ modules_headroom = bzimage_headroom(
+ (char *)(unsigned long)mod[0].mod_start,
+ (unsigned long)(mod[0].mod_end - mod[0].mod_start));
+
 for ( i = boot_e820.nr_map-1; i >= 0; i-- )
 {
 uint64_t s, e, mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
@@ -720,11 +726,6 @@ void __init __start_xen(unsigned long mb
 "D" (__va(__pa(cpu0_stack))), "c" (STACK_SIZE) : "memory" );
 }
 #endif
-
- if ( modules_headroom == -1 )
- modules_headroom = bzimage_headroom(
- (char *)(unsigned long)mod[0].mod_start,
- (unsigned long)(mod[0].mod_end - mod[0].mod_start));
 /* Is the region suitable for relocating the multiboot modules? */
 if ( !initial_images_start && (s < e) &&
Signed-off-by: Joseph Cihula <joseph.cihula@xxxxxxxxx>
Sorry for the churn in the code.
Joe
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] better fix for checking if bzImage, Cihula, Joseph <=
Previous by Date: [Xen-devel] [IA64] Weekly benchmark results [2009ww04] , KUWAMURA Shin'ya
Next by Date: Re: [Xen-devel] [PATCH 0/11] Add ixgbe support , Steven Smith
Previous by Thread: [Xen-devel] [IA64] Weekly benchmark results [2009ww04] , KUWAMURA Shin'ya
Next by Thread: [Xen-devel] [PATCH 1/5] x86-64: use MFNs for linking together pages on lists , Jan Beulich
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /