Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 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> |
Sam Ravnborg | 08b6d29 | 2008-01-30 13:33:25 +0100 | [diff] [blame] | 7 | #include <linux/init.h> |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 8 | |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 9 | #include <asm/boot.h> |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 10 | #include <asm/asm.h> |
Jeremy Fitzhardinge | 0341c14 | 2009-02-13 11:14:01 -0800 | [diff] [blame] | 11 | #include <asm/page_types.h> |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 12 | |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 13 | #include <xen/interface/elfnote.h> |
Jeremy Fitzhardinge | 7e0edc1 | 2008-05-31 01:33:04 +0100 | [diff] [blame] | 14 | #include <asm/xen/interface.h> |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 15 | |
Sam Ravnborg | 08b6d29 | 2008-01-30 13:33:25 +0100 | [diff] [blame] | 16 | __INIT |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 17 | ENTRY(startup_xen) |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 18 | cld |
Jeremy Fitzhardinge | 8c5e5ac | 2008-07-08 15:06:44 -0700 | [diff] [blame] | 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 |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 26 | jmp xen_start_kernel |
Sam Ravnborg | 08b6d29 | 2008-01-30 13:33:25 +0100 | [diff] [blame] | 27 | |
| 28 | __FINIT |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 29 | |
Jeremy Fitzhardinge | a987b16 | 2008-06-16 15:01:56 -0700 | [diff] [blame] | 30 | .pushsection .text |
Konrad Rzeszutek Wilk | 7d0642b | 2012-07-11 15:03:18 -0400 | [diff] [blame] | 31 | .balign PAGE_SIZE |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 32 | ENTRY(hypercall_page) |
Konrad Rzeszutek Wilk | 7d0642b | 2012-07-11 15:03:18 -0400 | [diff] [blame] | 33 | #define NEXT_HYPERCALL(x) \ |
| 34 | ENTRY(xen_hypercall_##x) \ |
| 35 | .skip 32 |
| 36 | |
| 37 | NEXT_HYPERCALL(set_trap_table) |
| 38 | NEXT_HYPERCALL(mmu_update) |
| 39 | NEXT_HYPERCALL(set_gdt) |
| 40 | NEXT_HYPERCALL(stack_switch) |
| 41 | NEXT_HYPERCALL(set_callbacks) |
| 42 | NEXT_HYPERCALL(fpu_taskswitch) |
| 43 | NEXT_HYPERCALL(sched_op_compat) |
| 44 | NEXT_HYPERCALL(platform_op) |
| 45 | NEXT_HYPERCALL(set_debugreg) |
| 46 | NEXT_HYPERCALL(get_debugreg) |
| 47 | NEXT_HYPERCALL(update_descriptor) |
| 48 | NEXT_HYPERCALL(ni) |
| 49 | NEXT_HYPERCALL(memory_op) |
| 50 | NEXT_HYPERCALL(multicall) |
| 51 | NEXT_HYPERCALL(update_va_mapping) |
| 52 | NEXT_HYPERCALL(set_timer_op) |
| 53 | NEXT_HYPERCALL(event_channel_op_compat) |
| 54 | NEXT_HYPERCALL(xen_version) |
| 55 | NEXT_HYPERCALL(console_io) |
| 56 | NEXT_HYPERCALL(physdev_op_compat) |
| 57 | NEXT_HYPERCALL(grant_table_op) |
| 58 | NEXT_HYPERCALL(vm_assist) |
| 59 | NEXT_HYPERCALL(update_va_mapping_otherdomain) |
| 60 | NEXT_HYPERCALL(iret) |
| 61 | NEXT_HYPERCALL(vcpu_op) |
| 62 | NEXT_HYPERCALL(set_segment_base) |
| 63 | NEXT_HYPERCALL(mmuext_op) |
| 64 | NEXT_HYPERCALL(xsm_op) |
| 65 | NEXT_HYPERCALL(nmi_op) |
| 66 | NEXT_HYPERCALL(sched_op) |
| 67 | NEXT_HYPERCALL(callback_op) |
| 68 | NEXT_HYPERCALL(xenoprof_op) |
| 69 | NEXT_HYPERCALL(event_channel_op) |
| 70 | NEXT_HYPERCALL(physdev_op) |
| 71 | NEXT_HYPERCALL(hvm_op) |
| 72 | NEXT_HYPERCALL(sysctl) |
| 73 | NEXT_HYPERCALL(domctl) |
| 74 | NEXT_HYPERCALL(kexec_op) |
| 75 | NEXT_HYPERCALL(tmem_op) /* 38 */ |
| 76 | ENTRY(xen_hypercall_rsvr) |
| 77 | .skip 320 |
| 78 | NEXT_HYPERCALL(mca) /* 48 */ |
| 79 | NEXT_HYPERCALL(arch_1) |
| 80 | NEXT_HYPERCALL(arch_2) |
| 81 | NEXT_HYPERCALL(arch_3) |
| 82 | NEXT_HYPERCALL(arch_4) |
| 83 | NEXT_HYPERCALL(arch_5) |
| 84 | NEXT_HYPERCALL(arch_6) |
| 85 | .balign PAGE_SIZE |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 86 | .popsection |
| 87 | |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 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") |
Jeremy Fitzhardinge | 8c5e5ac | 2008-07-08 15:06:44 -0700 | [diff] [blame] | 91 | #ifdef CONFIG_X86_32 |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 92 | ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __PAGE_OFFSET) |
Jeremy Fitzhardinge | 8c5e5ac | 2008-07-08 15:06:44 -0700 | [diff] [blame] | 93 | #else |
| 94 | ELFNOTE(Xen, XEN_ELFNOTE_VIRT_BASE, _ASM_PTR __START_KERNEL_map) |
| 95 | #endif |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 96 | ELFNOTE(Xen, XEN_ELFNOTE_ENTRY, _ASM_PTR startup_xen) |
| 97 | ELFNOTE(Xen, XEN_ELFNOTE_HYPERCALL_PAGE, _ASM_PTR hypercall_page) |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 98 | ELFNOTE(Xen, XEN_ELFNOTE_FEATURES, .asciz "!writable_page_tables|pae_pgdir_above_4gb") |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 99 | ELFNOTE(Xen, XEN_ELFNOTE_PAE_MODE, .asciz "yes") |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 100 | ELFNOTE(Xen, XEN_ELFNOTE_LOADER, .asciz "generic") |
Jeremy Fitzhardinge | 7e0edc1 | 2008-05-31 01:33:04 +0100 | [diff] [blame] | 101 | ELFNOTE(Xen, XEN_ELFNOTE_L1_MFN_VALID, |
| 102 | .quad _PAGE_PRESENT; .quad _PAGE_PRESENT) |
| 103 | ELFNOTE(Xen, XEN_ELFNOTE_SUSPEND_CANCEL, .long 1) |
Jeremy Fitzhardinge | 7077c33 | 2008-07-08 15:06:35 -0700 | [diff] [blame] | 104 | ELFNOTE(Xen, XEN_ELFNOTE_HV_START_LOW, _ASM_PTR __HYPERVISOR_VIRT_START) |
Jeremy Fitzhardinge | 8c5e5ac | 2008-07-08 15:06:44 -0700 | [diff] [blame] | 105 | ELFNOTE(Xen, XEN_ELFNOTE_PADDR_OFFSET, _ASM_PTR 0) |
Jeremy Fitzhardinge | 5ead97c | 2007-07-17 18:37:04 -0700 | [diff] [blame] | 106 | |
| 107 | #endif /*CONFIG_XEN */ |