4 #include <linux/config.h>
5 #include <linux/threads.h>
6 #include <linux/linkage.h>
7 #include <asm/segment.h>
9 #include <asm/thread_info.h>
10 #include <asm/asm-offsets.h>
11 #include <xen/interface/arch-x86_32.h>
14 * References to members of the new_cpu_data structure.
17 #define X86 new_cpu_data+CPUINFO_x86
18 #define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor
19 #define X86_MODEL new_cpu_data+CPUINFO_x86_model
20 #define X86_MASK new_cpu_data+CPUINFO_x86_mask
21 #define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math
22 #define X86_CPUID new_cpu_data+CPUINFO_cpuid_level
23 #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
24 #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
26 #define VIRT_ENTRY_OFFSET 0x0
27 .org VIRT_ENTRY_OFFSET
29 movl %esi,xen_start_info
32 /* Set up the stack pointer */
33 movl $(init_thread_union+THREAD_SIZE),%esp
36 xorl %eax,%eax # call CPUID with 0 -> return vendor ID
38 movl %eax,X86_CPUID # save CPUID level
39 movl %ebx,X86_VENDOR_ID # lo 4 chars
40 movl %edx,X86_VENDOR_ID+4 # next 4 chars
41 movl %ecx,X86_VENDOR_ID+8 # last 4 chars
43 movl $1,%eax # Use the CPUID instruction to get CPU type
45 movb %al,%cl # save reg for future use
46 andb $0x0f,%ah # mask processor family
48 andb $0xf0,%al # mask model
51 andb $0x0f,%cl # mask mask revision
53 movl %edx,X86_CAPABILITY
57 xorl %eax,%eax # Clear FS/GS and LDT
60 cld # gcc2 wants the direction flag cleared at all times
64 jmp L6 # main should never return here, but
65 # just in case, we know what happens.
67 #define HYPERCALL_PAGE_OFFSET 0x1000
68 .org HYPERCALL_PAGE_OFFSET
73 * Real beginning of normal "text" segment
81 .section ".bss.page_aligned","w"
82 ENTRY(empty_zero_page)
86 * This starts the data section.
91 * The Global Descriptor Table contains 28 quadwords, per-CPU.
94 .quad 0x0000000000000000 /* NULL descriptor */
95 .quad 0x0000000000000000 /* 0x0b reserved */
96 .quad 0x0000000000000000 /* 0x13 reserved */
97 .quad 0x0000000000000000 /* 0x1b reserved */
98 .quad 0x0000000000000000 /* 0x20 unused */
99 .quad 0x0000000000000000 /* 0x28 unused */
100 .quad 0x0000000000000000 /* 0x33 TLS entry 1 */
101 .quad 0x0000000000000000 /* 0x3b TLS entry 2 */
102 .quad 0x0000000000000000 /* 0x43 TLS entry 3 */
103 .quad 0x0000000000000000 /* 0x4b reserved */
104 .quad 0x0000000000000000 /* 0x53 reserved */
105 .quad 0x0000000000000000 /* 0x5b reserved */
107 .quad 0x00cf9a000000ffff /* 0x60 kernel 4GB code at 0x00000000 */
108 .quad 0x00cf92000000ffff /* 0x68 kernel 4GB data at 0x00000000 */
109 .quad 0x00cffa000000ffff /* 0x73 user 4GB code at 0x00000000 */
110 .quad 0x00cff2000000ffff /* 0x7b user 4GB data at 0x00000000 */
112 .quad 0x0000000000000000 /* 0x80 TSS descriptor */
113 .quad 0x0000000000000000 /* 0x88 LDT descriptor */
116 * Segments used for calling PnP BIOS have byte granularity.
117 * They code segments and data segments have fixed 64k limits,
118 * the transfer segment sizes are set at run time.
120 .quad 0x0000000000000000 /* 0x90 32-bit code */
121 .quad 0x0000000000000000 /* 0x98 16-bit code */
122 .quad 0x0000000000000000 /* 0xa0 16-bit data */
123 .quad 0x0000000000000000 /* 0xa8 16-bit data */
124 .quad 0x0000000000000000 /* 0xb0 16-bit data */
127 * The APM segments have byte granularity and their bases
128 * are set at run time. All have 64k limits.
130 .quad 0x0000000000000000 /* 0xb8 APM CS code */
131 .quad 0x0000000000000000 /* 0xc0 APM CS 16 code (16 bit) */
132 .quad 0x0000000000000000 /* 0xc8 APM DS data */
134 .quad 0x0000000000000000 /* 0xd0 - ESPFIX 16-bit SS */
135 .quad 0x0000000000000000 /* 0xd8 - unused */
136 .quad 0x0000000000000000 /* 0xe0 - unused */
137 .quad 0x0000000000000000 /* 0xe8 - unused */
138 .quad 0x0000000000000000 /* 0xf0 - unused */
139 .quad 0x0000000000000000 /* 0xf8 - GDT entry 31: double-fault TSS */
142 * __xen_guest information
145 .if (\value) < 0 || (\value) >= 0x10
146 utoa (((\value)>>4)&0x0fffffff)
148 .if ((\value) & 0xf) < 10
149 .byte '0' + ((\value) & 0xf)
151 .byte 'A' + ((\value) & 0xf) - 10
156 .ascii "GUEST_OS=linux,GUEST_VER=2.6"
157 .ascii ",XEN_VER=xen-3.0"
158 .ascii ",VIRT_BASE=0x"
160 #ifdef CONFIG_XEN_COMPAT_030002
161 .ascii ",ELF_PADDR_OFFSET=0x"
164 .ascii ",ELF_PADDR_OFFSET=0x0"
165 #endif /* !CONFIG_XEN_COMPAT_030002 */
166 .ascii ",VIRT_ENTRY=0x"
167 utoa (__PAGE_OFFSET + __PHYSICAL_START + VIRT_ENTRY_OFFSET)
168 .ascii ",HYPERCALL_PAGE=0x"
169 utoa ((__PHYSICAL_START+HYPERCALL_PAGE_OFFSET)>>PAGE_SHIFT)
170 .ascii ",FEATURES=writable_page_tables"
171 .ascii "|writable_descriptor_tables"
172 .ascii "|auto_translated_physmap"
173 .ascii "|pae_pgdir_above_4gb"
174 .ascii "|supervisor_mode_kernel"
175 #ifdef CONFIG_X86_PAE
176 .ascii ",PAE=yes[extended-cr3]"
180 .ascii ",LOADER=generic"