diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-06-11 15:15:28 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-06-11 15:15:28 +0100 |
commit | 46fce9fd2b3557c97e6ce9beec9ed17ad87d6f94 (patch) | |
tree | 65e982332204cd38bd19dbef11cdd82e2db42c2b /xen/arch/x86/boot/trampoline.S | |
parent | 035a14476e384494a9c70139dd1747d6e9fd448e (diff) | |
download | xen-46fce9fd2b3557c97e6ce9beec9ed17ad87d6f94.tar.gz xen-46fce9fd2b3557c97e6ce9beec9ed17ad87d6f94.tar.bz2 xen-46fce9fd2b3557c97e6ce9beec9ed17ad87d6f94.zip |
x86: get rid of BOOT_TRAMPOLINE
We recently saw a machine that has the EBDA extending as low as
0x7c000, so that Xen fails to boot after relocating the trampoline.
To fix this, I removed BOOT_TRAMPOLINE and bootsym_phys completely.
Here are the parts:
1) the trampoline segment is set to 64k below the EBDA. head.S grows
the ability to relocate the trampoline segment
2) reloc.c is made position-independent. It allocates data below the
trampoline, whose address is passed in _eax.
3) cmdline.S is called before relocating, so all bootsym_phys there
become sym_phys.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
jb: - fall back to low memory size (instead of segment 0x7c00) if EBDA
value is out of range
- also add upper limit check on EBDA value
- fix and simplify inline assembly operands in reloc_mbi_struct()
- use lret instead of retf
- renamed early_stack to wakeup_stack, defined and used now only
in wakeup.S
- aligned reloc.bin's end of .text to 16 bytes, so that checking
__bss_start == end works reliably
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/boot/trampoline.S')
-rw-r--r-- | xen/arch/x86/boot/trampoline.S | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S index dc4fd0603a..4421fc2c69 100644 --- a/xen/arch/x86/boot/trampoline.S +++ b/xen/arch/x86/boot/trampoline.S @@ -11,6 +11,13 @@ .long 111b - (off) - .; \ .popsection +#define bootsym_segrel(sym, off) \ + $0,$bootsym(sym); \ +111:; \ + .pushsection .trampoline_seg, "a"; \ + .long 111b - (off) - .; \ + .popsection + .globl trampoline_realmode_entry trampoline_realmode_entry: mov %cs,%ax @@ -151,14 +158,14 @@ trampoline_boot_cpu_entry: 1: mov %eax,%cr0 # CR0.PE = 0 (leave protected mode) /* Load proper real-mode values into %cs, %ds, %es and %ss. */ - ljmp $(BOOT_TRAMPOLINE>>4),$bootsym(1f) + ljmp bootsym_segrel(1f,2) 1: mov %cs,%ax mov %ax,%ds mov %ax,%es mov %ax,%ss /* Initialise stack pointer and IDT, and enable irqs. */ - mov $bootsym(early_stack),%sp + xor %sp,%sp lidt bootsym(rm_idt) sti @@ -220,7 +227,3 @@ rm_idt: .word 256*4-1, 0, 0 #include "edd.S" #include "video.S" #include "wakeup.S" - - .align 16 - .fill PAGE_SIZE,1,0 -early_stack: |