- .code16
+/*
+ * Trampoline code relocated to low memory.
+ *
+ * Care must taken when referencing symbols: they live in the relocated
+ * trampoline and in the hypervisor binary. The hypervisor symbols can either
+ * be accessed by their virtual address or by the physical address. When
+ * using the physical address eventually the physical start address of the
+ * hypervisor must be taken into account: after early boot the hypervisor
+ * will copy itself to high memory and writes its physical start address to
+ * trampoline_xen_phys_start in the low memory trampoline copy.
+ *
+ * Parts of the trampoline are needed for early boot only, while some other
+ * parts are needed as long as the hypervisor is active (e.g. wakeup code
+ * after suspend, bringup code for secondary cpus). The permanent parts should
+ * not reference any temporary low memory trampoline parts as those parts are
+ * not guaranteed to persist.
+ */
/* NB. bootsym() is only usable in real mode, or via BOOT_PSEUDORM_DS. */
#undef bootsym
.long 111b - (off) - .; \
.popsection
+/* Start of the permanent trampoline code. */
+
+ .code16
+
GLOBAL(trampoline_realmode_entry)
mov %cs,%ax
mov %ax,%ds
movabs $__high_start,%rax
jmpq *%rax
+#include "wakeup.S"
+
+/* The first page of trampoline is permanent, the rest boot-time only. */
+/* Reuse the boot trampoline on the 1st trampoline page as stack for wakeup. */
+ .equ wakeup_stack, trampoline_start + PAGE_SIZE
+ .global wakeup_stack
+
+/* From here on early boot only. */
+
.code32
trampoline_boot_cpu_entry:
cmpb $0,bootsym_rel(skip_realmode,5)
#include "mem.S"
#include "edd.S"
#include "video.S"
-#include "wakeup.S"