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

Re: [Xen-devel] Re: xen-kernel and EDD

To: Keir Fraser <keir.xen@xxxxxxxxx>
Subject: Re: [Xen-devel] Re: xen-kernel and EDD
From: Lin-Bao Zhang <2004.zhang@xxxxxxxxx>
Date: Thu, 25 Aug 2011 17:37:39 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 25 Aug 2011 02:38:38 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zU+d59v5nETH32pYjv8I8aAtSq+8HjW8wklqByhdcCo=; b=IN1y9Y4+LceaTix0R9XaRRNkn1xNKcb6t5Vb0hvQ8DBQHvebXnOEohbxgJ0dnU4+DF OQpv1V4ZO2choxMHzr9ldk2SmAdJRLWF/n2KHdq4ouQ9nUgs3heZerSmy6kU8K0fGTZe CAKxRgLGcX/UMDzWFubzfPFKRJfmHg235k7Ls=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CA7A87AB.1FB0D%keir.xen@xxxxxxxxx>
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>
References: <CANuKePnVN1Rd8X=ibt8=FyqnbX6UPsddKqJozvkw06RNKr4LeA@xxxxxxxxxxxxxx> <CA7A87AB.1FB0D%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
2011/8/24 Keir Fraser <keir.xen@xxxxxxxxx>:
> You can ignore the bit of the patch that touches BOOT_TRAMPOLINE in
> include/asm-x86/config.h. You just need to apply the parts of the patch that
> affect arch/x86/boot/trampoline.S.
>
>  K.
>

thanks very much!we have successfully booted xen-hypervisor .
Following is our final patch: I still define BOOT_TRAMPOLINE 0X7C000 .
We are using both HP P410i  and Brocade FC card. now it seems that
this bug doesn't relate directly with Brocade option rom.
but I guess Brocade option rom code may make Stack grow much more than
that Brocade card doesn't exist .
so when old 0x98000 stack top location , this stack will destroy P410i
EBDA when stack grows downwards.
meaning that , Brocade option code will make stack larger(this can be
verified by disable Brocade option rom code , 0x98000 still can work
in our system).


anway , following patch can indeed fix this bug, quite thank Keir's
continuous help!


diff --git a/arch/x86/boot/head.S b/arch/x86/boot/head.S
index 7e6c9e6..f761ef9 100644
--- a/arch/x86/boot/head.S
+++ b/arch/x86/boot/head.S
@@ -168,7 +168,7 @@ __start:
         mov     $trampoline_end - trampoline_start,%ecx
         rep     movsb

-        mov     $0x98000,%esp
+        mov     $(BOOT_TRAMPOLINE + 0x4000),%esp
         call    cmdline_parse_early

         /* Jump into the relocated trampoline. */
diff --git a/arch/x86/boot/trampoline.S b/arch/x86/boot/trampoline.S
index 4687be2..6ffaa81 100644
--- a/arch/x86/boot/trampoline.S
+++ b/arch/x86/boot/trampoline.S
@@ -23,12 +23,20 @@ idt_48: .word   0, 0, 0 # base = limit = 0
 gdt_48: .word   6*8-1
         .long   bootsym_phys(trampoline_gdt)
 trampoline_gdt:
-        .quad   0x0000000000000000     /* 0x0000: unused */
-        .quad   0x00cf9a000000ffff     /* 0x0008: ring 0 code, 32-bit mode */
-        .quad   0x00af9a000000ffff     /* 0x0010: ring 0 code, 64-bit mode */
-        .quad   0x00cf92000000ffff     /* 0x0018: ring 0 data */
-        .quad   0x00009a090000ffff     /* 0x0020: real-mode code @ 0x90000 */
-        .quad   0x000092090000ffff     /* 0x0028: real-mode data @ 0x90000 */
+        /* 0x0000: unused */
+        .quad   0x0000000000000000
+        /* 0x0008: ring 0 code, 32-bit mode */
+        .quad   0x00cf9a000000ffff
+        /* 0x0010: ring 0 code, 64-bit mode */
+        .quad   0x00af9a000000ffff
+        /* 0x0018: ring 0 data */
+        .quad   0x00cf92000000ffff
+        /* 0x0020: real-mode code @ BOOT_TRAMPOLINE */
+        .long   0x0000ffff | ((BOOT_TRAMPOLINE & 0x00ffff) << 16)
+        .long   0x00009a00 | ((BOOT_TRAMPOLINE & 0xff0000) >> 16)
+        /* 0x0028: real-mode data @ BOOT_TRAMPOLINE */
+        .long   0x0000ffff | ((BOOT_TRAMPOLINE & 0x00ffff) << 16)
+        .long   0x00009200 | ((BOOT_TRAMPOLINE & 0xff0000) >> 16)

 cpuid_ext_features:
         .long   0
@@ -142,7 +150,7 @@ trampoline_boot_cpu_entry:
         mov     %ax,%es
         mov     %ax,%ss

-        /* Stack grows down from 0x93000. Initialise IDT and enable irqs. */
+        /* Stack grows down from +0x3000. Initialise IDT and enable irqs. */
         mov     $0x3000,%sp
         lidt    bootsym(rm_idt)
         sti
diff --git a/include/asm-x86/config.h b/include/asm-x86/config.h
index 7fd368f..5efb374 100644
--- a/include/asm-x86/config.h
+++ b/include/asm-x86/config.h
@@ -89,7 +89,7 @@

 #define CONFIG_DMA_BITSIZE 32

-#define BOOT_TRAMPOLINE 0x90000
+#define BOOT_TRAMPOLINE 0x7c000
 #define bootsym_phys(sym)                                 \
     (((unsigned long)&(sym)-(unsigned long)&trampoline_start)+BOOT_TRAMPOLINE)
 #define bootsym(sym)

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