debuggers.hg

view xen/include/asm-x86/config.h @ 3659:bf2c38625b39

bitkeeper revision 1.1159.212.72 (42011b79Y7C9nEKFZ5pdQXwp8jC9hw)

More x86/64. Now boot secondary CPUs, but I seem to have problems
executing IRET, so interrupts are fatal.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@scramble.cl.cam.ac.uk
date Wed Feb 02 18:27:05 2005 +0000 (2005-02-02)
parents fec8b1778268
children 1c55bbe02576
line source
1 /******************************************************************************
2 * config.h
3 *
4 * A Linux-style configuration list.
5 */
7 #ifndef __X86_CONFIG_H__
8 #define __X86_CONFIG_H__
10 #ifdef __i386__
11 #define CONFIG_VMX 1
12 #endif
14 #define CONFIG_X86 1
16 #define CONFIG_SMP 1
17 #define CONFIG_X86_LOCAL_APIC 1
18 #define CONFIG_X86_GOOD_APIC 1
19 #define CONFIG_X86_IO_APIC 1
20 #define CONFIG_X86_L1_CACHE_SHIFT 5
22 #define CONFIG_ACPI 1
23 #define CONFIG_ACPI_BOOT 1
25 #define CONFIG_PCI 1
26 #define CONFIG_PCI_DIRECT 1
27 #if defined(__i386__)
28 #define CONFIG_PCI_BIOS 1
29 #endif
31 #define CONFIG_IDE 1
32 #define CONFIG_BLK_DEV_IDE 1
33 #define CONFIG_BLK_DEV_IDEDMA 1
34 #define CONFIG_BLK_DEV_IDEPCI 1
35 #define CONFIG_IDEDISK_MULTI_MODE 1
36 #define CONFIG_IDEDISK_STROKE 1
37 #define CONFIG_IDEPCI_SHARE_IRQ 1
38 #define CONFIG_BLK_DEV_IDEDMA_PCI 1
39 #define CONFIG_IDEDMA_PCI_AUTO 1
40 #define CONFIG_IDEDMA_AUTO 1
41 #define CONFIG_IDEDMA_ONLYDISK 1
42 #define CONFIG_BLK_DEV_IDE_MODES 1
43 #define CONFIG_BLK_DEV_PIIX 1
45 #define CONFIG_SCSI 1
46 #define CONFIG_SCSI_LOGGING 1
47 #define CONFIG_BLK_DEV_SD 1
48 #define CONFIG_SD_EXTRA_DEVS 40
49 #define CONFIG_SCSI_MULTI_LUN 1
51 #define CONFIG_XEN_ATTENTION_KEY 1
53 #define HZ 100
55 /*
56 * Just to keep compiler happy.
57 * NB. DO NOT CHANGE SMP_CACHE_BYTES WITHOUT FIXING arch/i386/entry.S!!!
58 * It depends on size of irq_cpustat_t, for example, being 64 bytes. :-)
59 */
60 #define SMP_CACHE_BYTES 64
61 #define NR_CPUS 16
63 /* Linkage for x86 */
64 #define __ALIGN .align 16,0x90
65 #define __ALIGN_STR ".align 16,0x90"
66 #define SYMBOL_NAME_STR(X) #X
67 #define SYMBOL_NAME(X) X
68 #define SYMBOL_NAME_LABEL(X) X##:
69 #ifdef __ASSEMBLY__
70 #define ALIGN __ALIGN
71 #define ALIGN_STR __ALIGN_STR
72 #define ENTRY(name) \
73 .globl SYMBOL_NAME(name); \
74 ALIGN; \
75 SYMBOL_NAME_LABEL(name)
76 #endif
78 #define barrier() __asm__ __volatile__("": : :"memory")
80 #define NR_hypercalls 32
82 #ifndef NDEBUG
83 #define MEMORY_GUARD
84 #endif
86 #ifndef __ASSEMBLY__
87 extern unsigned long _end; /* standard ELF symbol */
88 extern void __out_of_line_bug(int line) __attribute__((noreturn));
89 #define out_of_line_bug() __out_of_line_bug(__LINE__)
90 #endif /* __ASSEMBLY__ */
92 #define BUG() do { \
93 printk("BUG at %s:%d\n", __FILE__, __LINE__); \
94 __asm__ __volatile__("ud2"); \
95 } while (0)
97 #if defined(__x86_64__)
99 #define asmlinkage
101 #define XENHEAP_DEFAULT_MB (16)
103 #define PML4_ENTRY_BITS 39
104 #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
105 #define PML4_ADDR(_slot) \
106 ((((_slot ## UL) >> 8) * 0xffff000000000000UL) | \
107 (_slot ## UL << PML4_ENTRY_BITS))
109 /*
110 * Memory layout:
111 * 0x0000000000000000 - 0x00007fffffffffff [128TB, 2^47 bytes, PML4:0-255]
112 * Guest-defined use.
113 * 0x0000800000000000 - 0xffff7fffffffffff [16EB]
114 * Inaccessible: current arch only supports 48-bit sign-extended VAs.
115 * 0xffff800000000000 - 0xffff803fffffffff [256GB, 2^38 bytes, PML4:256]
116 * Read-only machine-to-phys translation table (GUEST ACCESSIBLE).
117 * 0xffff804000000000 - 0xffff807fffffffff [256GB, 2^38 bytes, PML4:256]
118 * Reserved for future shared info with the guest OS (GUEST ACCESSIBLE).
119 * 0xffff808000000000 - 0xffff80ffffffffff [512GB, 2^39 bytes, PML4:257]
120 * Read-only guest linear page table (GUEST ACCESSIBLE).
121 * 0xffff810000000000 - 0xffff817fffffffff [512GB, 2^39 bytes, PML4:258]
122 * Guest linear page table.
123 * 0xffff818000000000 - 0xffff81ffffffffff [512GB, 2^39 bytes, PML4:259]
124 * Shadow linear page table.
125 * 0xffff820000000000 - 0xffff827fffffffff [512GB, 2^39 bytes, PML4:260]
126 * Per-domain mappings (e.g., GDT, LDT).
127 * 0xffff828000000000 - 0xffff8283ffffffff [16GB, 2^34 bytes, PML4:261]
128 * Machine-to-phys translation table.
129 * 0xffff828400000000 - 0xffff8287ffffffff [16GB, 2^34 bytes, PML4:261]
130 * Page-frame information array.
131 * 0xffff828800000000 - 0xffff828bffffffff [16GB, 2^34 bytes, PML4:261]
132 * ioremap()/fixmap area.
133 * 0xffff828c00000000 - 0xffff82ffffffffff [464GB, PML4:261]
134 * Reserved for future use.
135 * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263]
136 * 1:1 direct mapping of all physical memory. Xen and its heap live here.
137 * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271]
138 * Reserved for future use.
139 * 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511]
140 * Guest-defined use.
141 */
144 /* Hypervisor reserves PML4 slots 256 to 271 inclusive. */
145 #define HYPERVISOR_VIRT_START (PML4_ADDR(256))
146 #define HYPERVISOR_VIRT_END (HYPERVISOR_VIRT_START + PML4_ENTRY_BYTES*16)
147 /* Slot 256: read-only guest-accessible machine-to-phys translation table. */
148 #define RO_MPT_VIRT_START (PML4_ADDR(256))
149 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + PML4_ENTRY_BYTES/2)
150 /* Slot 257: read-only guest-accessible linear page table. */
151 #define RO_LINEAR_PT_VIRT_START (PML4_ADDR(257))
152 #define RO_LINEAR_PT_VIRT_END (RO_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
153 /* Slot 258: linear page table (guest table). */
154 #define LINEAR_PT_VIRT_START (PML4_ADDR(258))
155 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
156 /* Slot 259: linear page table (shadow table). */
157 #define SH_LINEAR_PT_VIRT_START (PML4_ADDR(259))
158 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
159 /* Slot 260: per-domain mappings. */
160 #define PERDOMAIN_VIRT_START (PML4_ADDR(260))
161 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + PML4_ENTRY_BYTES)
162 /* Slot 261: machine-to-phys conversion table (16GB). */
163 #define RDWR_MPT_VIRT_START (PML4_ADDR(261))
164 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (16UL<<30))
165 /* Slot 261: page-frame information array (16GB). */
166 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
167 #define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (16UL<<30))
168 /* Slot 261: ioremap()/fixmap area (16GB). */
169 #define IOREMAP_VIRT_START (FRAMETABLE_VIRT_END)
170 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (16UL<<30))
171 /* Slot 262-263: A direct 1:1 mapping of all of physical memory. */
172 #define DIRECTMAP_VIRT_START (PML4_ADDR(262))
173 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2)
175 #define PGT_base_page_table PGT_l4_page_table
177 #define __HYPERVISOR_CS64 0x0810
178 #define __HYPERVISOR_CS32 0x0808
179 #define __HYPERVISOR_CS __HYPERVISOR_CS64
180 #define __HYPERVISOR_DS64 0x0000
181 #define __HYPERVISOR_DS32 0x0818
182 #define __HYPERVISOR_DS __HYPERVISOR_DS64
184 /* For generic assembly code: use macros to define operation/operand sizes. */
185 #define __OS "q" /* Operation Suffix */
186 #define __OP "r" /* Operand Prefix */
188 #elif defined(__i386__)
190 #define asmlinkage __attribute__((regparm(0)))
192 #define XENHEAP_DEFAULT_MB (12)
193 #define DIRECTMAP_PHYS_END (12*1024*1024)
195 /* Hypervisor owns top 64MB of virtual address space. */
196 #define __HYPERVISOR_VIRT_START 0xFC000000
197 #define HYPERVISOR_VIRT_START (0xFC000000UL)
199 /*
200 * First 4MB are mapped read-only for all. It's for the machine->physical
201 * mapping table (MPT table). The following are virtual addresses.
202 */
203 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
204 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + (4*1024*1024))
205 /* Xen heap extends to end of 1:1 direct-mapped memory region. */
206 #define DIRECTMAP_VIRT_START (RO_MPT_VIRT_END)
207 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + DIRECTMAP_PHYS_END)
208 /* Machine-to-phys conversion table. */
209 #define RDWR_MPT_VIRT_START (DIRECTMAP_VIRT_END)
210 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (4*1024*1024))
211 /* Variable-length page-frame information array. */
212 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
213 #define FRAMETABLE_VIRT_END (FRAMETABLE_VIRT_START + (24*1024*1024))
214 /* Next 4MB of virtual address space is used as a linear p.t. mapping. */
215 #define LINEAR_PT_VIRT_START (FRAMETABLE_VIRT_END)
216 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + (4*1024*1024))
217 /* Next 4MB of virtual address space is used as a shadow linear p.t. map. */
218 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
219 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + (4*1024*1024))
220 /* Next 4MB of virtual address space used for per-domain mappings (eg. GDT). */
221 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
222 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + (4*1024*1024))
223 /* Penultimate 4MB of virtual address space used for domain page mappings. */
224 #define MAPCACHE_VIRT_START (PERDOMAIN_VIRT_END)
225 #define MAPCACHE_VIRT_END (MAPCACHE_VIRT_START + (4*1024*1024))
226 /* Final 4MB of virtual address space used for ioremap(). */
227 #define IOREMAP_VIRT_START (MAPCACHE_VIRT_END)
228 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (4*1024*1024))
230 #define PGT_base_page_table PGT_l2_page_table
232 #define __HYPERVISOR_CS 0x0808
233 #define __HYPERVISOR_DS 0x0810
235 /* For generic assembly code: use macros to define operation/operand sizes. */
236 #define __OS "l" /* Operation Suffix */
237 #define __OP "e" /* Operand Prefix */
239 #endif /* __i386__ */
241 #ifndef __ASSEMBLY__
242 extern unsigned long xenheap_phys_end; /* user-configurable */
243 #endif
245 #define GDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
246 #define GDT_VIRT_END(ed) (GDT_VIRT_START(ed) + (64*1024))
247 #define LDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
248 #define LDT_VIRT_END(ed) (LDT_VIRT_START(ed) + (64*1024))
250 #define PDPT_VCPU_SHIFT 5
251 #define PDPT_VCPU_VA_SHIFT (PDPT_VCPU_SHIFT + PAGE_SHIFT)
253 #if defined(__x86_64__)
254 #define ELFSIZE 64
255 #else
256 #define ELFSIZE 32
257 #endif
259 #endif /* __X86_CONFIG_H__ */