aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot/head.S
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-08-19 09:54:26 +0100
committerJan Beulich <jbeulich@novell.com>2011-08-19 09:54:26 +0100
commitbc4a68f21f43c2e37346cf5a1f37c19a53b540c2 (patch)
tree3b4af0bd3182a264bbe3b84a65e21a606e4f43ab /xen/arch/x86/boot/head.S
parent2f399b3bb0cae8072ed42856eac6a805728516fe (diff)
downloadxen-bc4a68f21f43c2e37346cf5a1f37c19a53b540c2.tar.gz
xen-bc4a68f21f43c2e37346cf5a1f37c19a53b540c2.tar.bz2
xen-bc4a68f21f43c2e37346cf5a1f37c19a53b540c2.zip
x86: make run-time part of trampoline relocatable
In order to eliminate an initial hack in the EFI boot code (where memory for the trampoline was just "claimed" instead of properly allocated), the trampoline code must no longer make assumption on the address at which it would be located. For the time being, the fixed address is being retained for the traditional multiboot path. As an additional benefit (at least from my pov) it allows confining the visibility of the BOOT_TRAMPOLINE definition to just the boot code. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/boot/head.S')
-rw-r--r--xen/arch/x86/boot/head.S13
1 files changed, 12 insertions, 1 deletions
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 0c59f2a750..d092579462 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -9,7 +9,7 @@
.text
.code32
-#undef bootsym_phys
+#define BOOT_TRAMPOLINE 0x7c000
#define sym_phys(sym) ((sym) - __XEN_VIRT_START)
#define bootsym_phys(sym) ((sym) - trampoline_start + BOOT_TRAMPOLINE)
@@ -189,6 +189,17 @@ __start:
mov %edi,sym_phys(idle_pg_table_l2) + (__PAGE_OFFSET>>18)
#endif
+ /* Apply relocations to bootstrap trampoline. */
+ mov $BOOT_TRAMPOLINE,%edx
+ mov $sym_phys(__trampoline_rel_start),%edi
+ mov %edx,sym_phys(trampoline_phys)
+1:
+ mov (%edi),%eax
+ add %edx,(%edi,%eax)
+ add $4,%edi
+ cmp $sym_phys(__trampoline_rel_stop),%edi
+ jb 1b
+
/* Copy bootstrap trampoline to low memory, below 1MB. */
mov $sym_phys(trampoline_start),%esi
mov $bootsym_phys(trampoline_start),%edi