blob: 7faed5869e5bf215cafe4c0fdbe24ba38fcd66d0 [file] [log] [blame]
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -07001/* 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>
Sam Ravnborg08b6d292008-01-30 13:33:25 +01007#include <linux/init.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -07008
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -07009#include <asm/boot.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070010#include <asm/asm.h>
Jeremy Fitzhardinge0341c142009-02-13 11:14:01 -080011#include <asm/page_types.h>
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070012
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070013#include <xen/interface/elfnote.h>
Jeremy Fitzhardinge7e0edc12008-05-31 01:33:04 +010014#include <asm/xen/interface.h>
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070015
Sam Ravnborg08b6d292008-01-30 13:33:25 +010016 __INIT
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070017ENTRY(startup_xen)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070018 cld
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070019#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
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070026 jmp xen_start_kernel
Sam Ravnborg08b6d292008-01-30 13:33:25 +010027
28 __FINIT
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070029
Jeremy Fitzhardingea987b162008-06-16 15:01:56 -070030.pushsection .text
Konrad Rzeszutek Wilk7d0642b2012-07-11 15:03:18 -040031 .balign PAGE_SIZE
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070032ENTRY(hypercall_page)
Konrad Rzeszutek Wilk7d0642b2012-07-11 15:03:18 -040033#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
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070086.popsection
87
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070088 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")
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070091#ifdef CONFIG_X86_32
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070092 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __PAGE_OFFSET)
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -070093#else
94 ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __START_KERNEL_map)
95#endif
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -070096 ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen)
97 ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070098 ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb")
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -070099 ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes")
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -0700100 ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic")
Jeremy Fitzhardinge7e0edc12008-05-31 01:33:04 +0100101 ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
102 .quad _PAGE_PRESENT; .quad _PAGE_PRESENT)
103 ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
Jeremy Fitzhardinge7077c332008-07-08 15:06:35 -0700104 ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START)
Jeremy Fitzhardinge8c5e5ac2008-07-08 15:06:44 -0700105 ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, _ASM_PTR 0)
Jeremy Fitzhardinge5ead97c2007-07-17 18:37:04 -0700106
107#endif /*CONFIG_XEN */