1 #include <xtf/asm_macros.h>
4 #include <arch/processor.h>
5 #include <arch/msr-index.h>
6 #include <arch/segment.h>
8 #include <xen/elfnote.h>
10 .section ".text.head", "ax", @progbits
11 .code32 /* Always starts in 32bit flat mode. */
12 GLOBAL(_elf_start) /* HVM common setup. */
14 #if CONFIG_PAGING_LEVELS > 0 /* Paging setup for CR3 and CR4 */
16 #if CONFIG_PAGING_LEVELS == 2
17 mov $X86_CR4_PSE, %eax
18 #elif CONFIG_PAGING_LEVELS == 3 || CONFIG_PAGING_LEVELS == 4
19 mov $X86_CR4_PAE, %eax
21 # error Bad paging mode
27 #endif /* CONFIG_PAGING_LEVELS > 0 */
29 #ifdef __x86_64__ /* EFER.LME = 1 */
34 #endif /* __x86_64__ */
36 #if CONFIG_PAGING_LEVELS > 0 /* CR0.PG = 1 */
37 # define MAYBE_PG X86_CR0_PG
40 #endif /* CONFIG_PAGING_LEVELS > 0 */
43 or $(X86_CR0_WP | MAYBE_PG), %eax
48 /* Load code segment. */
54 /* Load data segments. */
55 1: mov $__USER_DS, %eax
63 /* Move onto the boot stack. */
64 mov $boot_stack + PAGE_SIZE, %esp
72 /* panic() if xtf_main manages to return. */
74 lea .Lmain_err_msg(%rip), %rdi
76 mov $.Lmain_err_msg, %eax
81 DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
83 /* All HVM XTF guests are compatible with the PVH ABI. */
85 mov %ebx, pvh_start_info
88 ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY, .long _pvh_start)
93 * indent-tabs-mode: nil