xref: /openbmc/linux/arch/x86/xen/xen-head.S (revision 12eb4683)
1/* Xen-specific pieces of head.S, intended to be included in the right
2	place in head.S */
3
4#ifdef CONFIG_XEN
5
6#include <linux/elfnote.h>
7#include <linux/init.h>
8
9#include <asm/boot.h>
10#include <asm/asm.h>
11#include <asm/page_types.h>
12
13#include <xen/interface/elfnote.h>
14#include <asm/xen/interface.h>
15
16	__INIT
17ENTRY(startup_xen)
18	cld
19#ifdef CONFIG_X86_32
20	mov %esi,xen_start_info
21	mov $init_thread_union+THREAD_SIZE,%esp
22#else
23	mov %rsi,xen_start_info
24	mov $init_thread_union+THREAD_SIZE,%rsp
25#endif
26	jmp xen_start_kernel
27
28	__FINIT
29
30.pushsection .text
31	.balign PAGE_SIZE
32ENTRY(hypercall_page)
33#define NEXT_HYPERCALL(x) \
34	ENTRY(xen_hypercall_##x) \
35	.skip 32
36
37NEXT_HYPERCALL(set_trap_table)
38NEXT_HYPERCALL(mmu_update)
39NEXT_HYPERCALL(set_gdt)
40NEXT_HYPERCALL(stack_switch)
41NEXT_HYPERCALL(set_callbacks)
42NEXT_HYPERCALL(fpu_taskswitch)
43NEXT_HYPERCALL(sched_op_compat)
44NEXT_HYPERCALL(platform_op)
45NEXT_HYPERCALL(set_debugreg)
46NEXT_HYPERCALL(get_debugreg)
47NEXT_HYPERCALL(update_descriptor)
48NEXT_HYPERCALL(ni)
49NEXT_HYPERCALL(memory_op)
50NEXT_HYPERCALL(multicall)
51NEXT_HYPERCALL(update_va_mapping)
52NEXT_HYPERCALL(set_timer_op)
53NEXT_HYPERCALL(event_channel_op_compat)
54NEXT_HYPERCALL(xen_version)
55NEXT_HYPERCALL(console_io)
56NEXT_HYPERCALL(physdev_op_compat)
57NEXT_HYPERCALL(grant_table_op)
58NEXT_HYPERCALL(vm_assist)
59NEXT_HYPERCALL(update_va_mapping_otherdomain)
60NEXT_HYPERCALL(iret)
61NEXT_HYPERCALL(vcpu_op)
62NEXT_HYPERCALL(set_segment_base)
63NEXT_HYPERCALL(mmuext_op)
64NEXT_HYPERCALL(xsm_op)
65NEXT_HYPERCALL(nmi_op)
66NEXT_HYPERCALL(sched_op)
67NEXT_HYPERCALL(callback_op)
68NEXT_HYPERCALL(xenoprof_op)
69NEXT_HYPERCALL(event_channel_op)
70NEXT_HYPERCALL(physdev_op)
71NEXT_HYPERCALL(hvm_op)
72NEXT_HYPERCALL(sysctl)
73NEXT_HYPERCALL(domctl)
74NEXT_HYPERCALL(kexec_op)
75NEXT_HYPERCALL(tmem_op) /* 38 */
76ENTRY(xen_hypercall_rsvr)
77	.skip 320
78NEXT_HYPERCALL(mca) /* 48 */
79NEXT_HYPERCALL(arch_1)
80NEXT_HYPERCALL(arch_2)
81NEXT_HYPERCALL(arch_3)
82NEXT_HYPERCALL(arch_4)
83NEXT_HYPERCALL(arch_5)
84NEXT_HYPERCALL(arch_6)
85	.balign PAGE_SIZE
86.popsection
87
88	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
89	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
90	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
91#ifdef CONFIG_X86_32
92	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __PAGE_OFFSET)
93#else
94	ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __START_KERNEL_map)
95#endif
96	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
97	ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
98	ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .asciz "!writable_page_tables|pae_pgdir_above_4gb")
99	ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
100	ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
101	ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
102		.quad _PAGE_PRESENT; .quad _PAGE_PRESENT)
103	ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
104	ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   _ASM_PTR __HYPERVISOR_VIRT_START)
105	ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   _ASM_PTR 0)
106
107#endif /*CONFIG_XEN */
108