[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.