Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / x86 / xen / xen-head.S
blob485b69585540dc4fd67eada10d3a4c028aa81394
1 /* Xen-specific pieces of head.S, intended to be included in the right
2         place in head.S */
4 #ifdef CONFIG_XEN
6 #include <linux/elfnote.h>
7 #include <linux/init.h>
9 #include <asm/boot.h>
10 #include <asm/asm.h>
11 #include <asm/page_types.h>
13 #include <xen/interface/elfnote.h>
14 #include <xen/interface/features.h>
15 #include <asm/xen/interface.h>
17 #ifdef CONFIG_XEN_PVH
18 #define PVH_FEATURES_STR  "|writable_descriptor_tables|auto_translated_physmap|supervisor_mode_kernel"
19 /* Note the lack of 'hvm_callback_vector'. Older hypervisor will
20  * balk at this being part of XEN_ELFNOTE_FEATURES, so we put it in
21  * XEN_ELFNOTE_SUPPORTED_FEATURES which older hypervisors will ignore.
22  */
23 #define PVH_FEATURES ((1 << XENFEAT_writable_page_tables) | \
24                       (1 << XENFEAT_auto_translated_physmap) | \
25                       (1 << XENFEAT_supervisor_mode_kernel) | \
26                       (1 << XENFEAT_hvm_callback_vector))
27 /* The XENFEAT_writable_page_tables is not stricly neccessary as we set that
28  * up regardless whether this CONFIG option is enabled or not, but it
29  * clarifies what the right flags need to be.
30  */
31 #else
32 #define PVH_FEATURES_STR  ""
33 #define PVH_FEATURES (0)
34 #endif
36         __INIT
37 ENTRY(startup_xen)
38         cld
39 #ifdef CONFIG_X86_32
40         mov %esi,xen_start_info
41         mov $init_thread_union+THREAD_SIZE,%esp
42 #else
43         mov %rsi,xen_start_info
44         mov $init_thread_union+THREAD_SIZE,%rsp
45 #endif
46         jmp xen_start_kernel
48         __FINIT
50 .pushsection .text
51         .balign PAGE_SIZE
52 ENTRY(hypercall_page)
53 #define NEXT_HYPERCALL(x) \
54         ENTRY(xen_hypercall_##x) \
55         .skip 32
57 NEXT_HYPERCALL(set_trap_table)
58 NEXT_HYPERCALL(mmu_update)
59 NEXT_HYPERCALL(set_gdt)
60 NEXT_HYPERCALL(stack_switch)
61 NEXT_HYPERCALL(set_callbacks)
62 NEXT_HYPERCALL(fpu_taskswitch)
63 NEXT_HYPERCALL(sched_op_compat)
64 NEXT_HYPERCALL(platform_op)
65 NEXT_HYPERCALL(set_debugreg)
66 NEXT_HYPERCALL(get_debugreg)
67 NEXT_HYPERCALL(update_descriptor)
68 NEXT_HYPERCALL(ni)
69 NEXT_HYPERCALL(memory_op)
70 NEXT_HYPERCALL(multicall)
71 NEXT_HYPERCALL(update_va_mapping)
72 NEXT_HYPERCALL(set_timer_op)
73 NEXT_HYPERCALL(event_channel_op_compat)
74 NEXT_HYPERCALL(xen_version)
75 NEXT_HYPERCALL(console_io)
76 NEXT_HYPERCALL(physdev_op_compat)
77 NEXT_HYPERCALL(grant_table_op)
78 NEXT_HYPERCALL(vm_assist)
79 NEXT_HYPERCALL(update_va_mapping_otherdomain)
80 NEXT_HYPERCALL(iret)
81 NEXT_HYPERCALL(vcpu_op)
82 NEXT_HYPERCALL(set_segment_base)
83 NEXT_HYPERCALL(mmuext_op)
84 NEXT_HYPERCALL(xsm_op)
85 NEXT_HYPERCALL(nmi_op)
86 NEXT_HYPERCALL(sched_op)
87 NEXT_HYPERCALL(callback_op)
88 NEXT_HYPERCALL(xenoprof_op)
89 NEXT_HYPERCALL(event_channel_op)
90 NEXT_HYPERCALL(physdev_op)
91 NEXT_HYPERCALL(hvm_op)
92 NEXT_HYPERCALL(sysctl)
93 NEXT_HYPERCALL(domctl)
94 NEXT_HYPERCALL(kexec_op)
95 NEXT_HYPERCALL(tmem_op) /* 38 */
96 ENTRY(xen_hypercall_rsvr)
97         .skip 320
98 NEXT_HYPERCALL(mca) /* 48 */
99 NEXT_HYPERCALL(arch_1)
100 NEXT_HYPERCALL(arch_2)
101 NEXT_HYPERCALL(arch_3)
102 NEXT_HYPERCALL(arch_4)
103 NEXT_HYPERCALL(arch_5)
104 NEXT_HYPERCALL(arch_6)
105         .balign PAGE_SIZE
106 .popsection
108         ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
109         ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,  .asciz "2.6")
110         ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,    .asciz "xen-3.0")
111 #ifdef CONFIG_X86_32
112         ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __PAGE_OFFSET)
113 #else
114         ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE,      _ASM_PTR __START_KERNEL_map)
115 #endif
116         ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,          _ASM_PTR startup_xen)
117         ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page)
118         ELFNOTE(Xen, XEN_ELFNOTE_FEATURES,       .ascii "!writable_page_tables|pae_pgdir_above_4gb"; .asciz PVH_FEATURES_STR)
119         ELFNOTE(Xen, XEN_ELFNOTE_SUPPORTED_FEATURES, .long (PVH_FEATURES) |
120                                                 (1 << XENFEAT_writable_page_tables) |
121                                                 (1 << XENFEAT_dom0))
122         ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE,       .asciz "yes")
123         ELFNOTE(Xen, XEN_ELFNOTE_LOADER,         .asciz "generic")
124         ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID,
125                 .quad _PAGE_PRESENT; .quad _PAGE_PRESENT)
126         ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1)
127         ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW,   _ASM_PTR __HYPERVISOR_VIRT_START)
128         ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET,   _ASM_PTR 0)
130 #endif /*CONFIG_XEN */