Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/amd64/xen-locore.S
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | .section __xen_guest | ||||
ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long, 0) | ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long, 0) | ||||
ELFNOTE(Xen, XEN_ELFNOTE_BSD_SYMTAB, .asciz, "yes") | ELFNOTE(Xen, XEN_ELFNOTE_BSD_SYMTAB, .asciz, "yes") | ||||
/* For PVHv2 support. */ | /* For PVHv2 support. */ | ||||
ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY, .long, VTOP(xen_start32)) | ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY, .long, VTOP(xen_start32)) | ||||
.text | .text | ||||
.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ | .p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ | ||||
NON_GPROF_ENTRY(hypercall_page) | ENTRY(hypercall_page) | ||||
.skip 0x1000, 0x90 /* Fill with "nop"s */ | .skip 0x1000, 0x90 /* Fill with "nop"s */ | ||||
/* Legacy PVH entry point, to be removed. */ | /* Legacy PVH entry point, to be removed. */ | ||||
NON_GPROF_ENTRY(xen_start) | ENTRY(xen_start) | ||||
/* Don't trust what the loader gives for rflags. */ | /* Don't trust what the loader gives for rflags. */ | ||||
pushq $PSL_KERNEL | pushq $PSL_KERNEL | ||||
popfq | popfq | ||||
/* Parameters for the xen init function */ | /* Parameters for the xen init function */ | ||||
movq %rsi, %rdi /* shared_info (arg 1) */ | movq %rsi, %rdi /* shared_info (arg 1) */ | ||||
movq %rsp, %rsi /* xenstack (arg 2) */ | movq %rsp, %rsi /* xenstack (arg 2) */ | ||||
/* Use our own stack */ | /* Use our own stack */ | ||||
movq $bootstack,%rsp | movq $bootstack,%rsp | ||||
xorl %ebp, %ebp | xorl %ebp, %ebp | ||||
/* u_int64_t hammer_time_xen(start_info_t *si, u_int64_t xenstack); */ | /* u_int64_t hammer_time_xen(start_info_t *si, u_int64_t xenstack); */ | ||||
call hammer_time_xen_legacy | call hammer_time_xen_legacy | ||||
movq %rax, %rsp /* set up kstack for mi_startup() */ | movq %rax, %rsp /* set up kstack for mi_startup() */ | ||||
call mi_startup /* autoconfiguration, mountroot etc */ | call mi_startup /* autoconfiguration, mountroot etc */ | ||||
/* NOTREACHED */ | /* NOTREACHED */ | ||||
0: hlt | 0: hlt | ||||
jmp 0b | jmp 0b | ||||
/* PVH entry point. */ | /* PVH entry point. */ | ||||
.code32 | .code32 | ||||
NON_GPROF_ENTRY(xen_start32) | ENTRY(xen_start32) | ||||
/* Load flat GDT */ | /* Load flat GDT */ | ||||
movl $VTOP(gdtdesc32), %eax | movl $VTOP(gdtdesc32), %eax | ||||
lgdt (%eax) | lgdt (%eax) | ||||
jmp $GDT_CODE, $VTOP(reload_cs) | jmp $GDT_CODE, $VTOP(reload_cs) | ||||
reload_cs: | reload_cs: | ||||
movw $GDT_DATA, %ax | movw $GDT_DATA, %ax | ||||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |