ia64/xen-unstable

view xen/include/asm-x86/config.h @ 1776:c2f673cea5e4

bitkeeper revision 1.1072.1.1 (40f4e51fLMgcKX4Sn6FNYePX6EqkGA)

Merge http://xen.bkbits.net:8080/xeno-unstable.bk
into gandalf.hpl.hp.com:/var/bk/xeno-unstable.bk
author xenbk@gandalf.hpl.hp.com
date Wed Jul 14 07:47:43 2004 +0000 (2004-07-14)
parents 15cbfb844361 f99dd2296127
children e91945007886
line source
1 /******************************************************************************
2 * config.h
3 *
4 * A Linux-style configuration list.
5 */
7 #ifndef __XEN_I386_CONFIG_H__
8 #define __XEN_I386_CONFIG_H__
10 #define CONFIG_X86 1
12 #define CONFIG_SMP 1
13 #define CONFIG_X86_LOCAL_APIC 1
14 #define CONFIG_X86_GOOD_APIC 1
15 #define CONFIG_X86_IO_APIC 1
16 #define CONFIG_X86_L1_CACHE_SHIFT 5
18 #define CONFIG_ACPI 1
19 #define CONFIG_ACPI_BOOT 1
21 #define CONFIG_PCI 1
22 #define CONFIG_PCI_DIRECT 1
23 #if defined(__i386__)
24 #define CONFIG_PCI_BIOS 1
25 #endif
27 #define CONFIG_IDE 1
28 #define CONFIG_BLK_DEV_IDE 1
29 #define CONFIG_BLK_DEV_IDEDMA 1
30 #define CONFIG_BLK_DEV_IDEPCI 1
31 #define CONFIG_IDEDISK_MULTI_MODE 1
32 #define CONFIG_IDEDISK_STROKE 1
33 #define CONFIG_IDEPCI_SHARE_IRQ 1
34 #define CONFIG_BLK_DEV_IDEDMA_PCI 1
35 #define CONFIG_IDEDMA_PCI_AUTO 1
36 #define CONFIG_IDEDMA_AUTO 1
37 #define CONFIG_IDEDMA_ONLYDISK 1
38 #define CONFIG_BLK_DEV_IDE_MODES 1
39 #define CONFIG_BLK_DEV_PIIX 1
41 #define CONFIG_SCSI 1
42 #define CONFIG_SCSI_LOGGING 1
43 #define CONFIG_BLK_DEV_SD 1
44 #define CONFIG_SD_EXTRA_DEVS 40
45 #define CONFIG_SCSI_MULTI_LUN 1
47 #define CONFIG_XEN_ATTENTION_KEY 1
49 #define HZ 100
51 /*
52 * Just to keep compiler happy.
53 * NB. DO NOT CHANGE SMP_CACHE_BYTES WITHOUT FIXING arch/i386/entry.S!!!
54 * It depends on size of irq_cpustat_t, for example, being 64 bytes. :-)
55 */
56 #define SMP_CACHE_BYTES 64
57 #define NR_CPUS 16
58 #define __cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
59 #define ____cacheline_aligned __cacheline_aligned
61 /*
62 * Amount of slack domain memory to leave in system, in megabytes.
63 * Prevents a hard out-of-memory crunch for things like network receive.
64 */
65 #define SLACK_DOMAIN_MEM_KILOBYTES 2048
67 /* Linkage for x86 */
68 #define asmlinkage __attribute__((regparm(0)))
69 #define __ALIGN .align 16,0x90
70 #define __ALIGN_STR ".align 16,0x90"
71 #define SYMBOL_NAME_STR(X) #X
72 #define SYMBOL_NAME(X) X
73 #define SYMBOL_NAME_LABEL(X) X##:
74 #ifdef __ASSEMBLY__
75 #define ALIGN __ALIGN
76 #define ALIGN_STR __ALIGN_STR
77 #define ENTRY(name) \
78 .globl SYMBOL_NAME(name); \
79 ALIGN; \
80 SYMBOL_NAME_LABEL(name)
81 #endif
83 #define barrier() __asm__ __volatile__("": : :"memory")
85 #define NR_hypercalls 32
87 #ifndef NDEBUG
88 #define MEMORY_GUARD
89 #endif
91 #ifndef __ASSEMBLY__
92 extern unsigned long _end; /* standard ELF symbol */
93 extern void __out_of_line_bug(int line) __attribute__((noreturn));
94 #define out_of_line_bug() __out_of_line_bug(__LINE__)
95 #endif /* __ASSEMBLY__ */
97 #if defined(__x86_64__)
99 #define XENHEAP_DEFAULT_MB (16)
101 #define PML4_ENTRY_BITS 39
102 #define PML4_ENTRY_BYTES (1UL<<PML4_ENTRY_BITS)
104 /*
105 * Memory layout:
106 * 0x0000000000000000 - 0x00007fffffffffff [128TB, 2^47 bytes, PML4:0-255]
107 * Guest-defined use.
108 * 0x0000800000000000 - 0xffff7fffffffffff [16EB]
109 * Inaccessible: current arch only supports 48-bit sign-extended VAs.
110 * 0xffff800000000000 - 0xffff803fffffffff [256GB, 2^38 bytes, PML4:256]
111 * Read-only machine-to-phys translation table (GUEST ACCESSIBLE).
112 * 0xffff804000000000 - 0xffff807fffffffff [256GB, 2^38 bytes, PML4:256]
113 * Reserved for future shared info with the guest OS (GUEST ACCESSIBLE).
114 * 0xffff808000000000 - 0xffff80ffffffffff [512GB, 2^39 bytes, PML4:257]
115 * Read-only guest linear page table (GUEST ACCESSIBLE).
116 * 0xffff810000000000 - 0xffff817fffffffff [512GB, 2^39 bytes, PML4:258]
117 * Guest linear page table.
118 * 0xffff818000000000 - 0xffff81ffffffffff [512GB, 2^39 bytes, PML4:259]
119 * Shadow linear page table.
120 * 0xffff820000000000 - 0xffff827fffffffff [512GB, 2^39 bytes, PML4:260]
121 * Per-domain mappings (e.g., GDT, LDT).
122 * 0xffff828000000000 - 0xffff8287ffffffff [512GB, 2^39 bytes, PML4:261]
123 * Reserved for future use.
124 * 0xffff830000000000 - 0xffff83ffffffffff [1TB, 2^40 bytes, PML4:262-263]
125 * 1:1 direct mapping of all physical memory. Xen and its heap live here.
126 * 0xffff840000000000 - 0xffff87ffffffffff [4TB, 2^42 bytes, PML4:264-271]
127 * Reserved for future use.
128 * 0xffff880000000000 - 0xffffffffffffffff [120TB, PML4:272-511]
129 * Guest-defined use.
130 */
132 /* Hypervisor reserves PML4 slots 256 to 271 inclusive. */
133 #define HYPERVISOR_VIRT_START (0xFFFF800000000000UL)
134 #define HYPERVISOR_VIRT_END (0xFFFF880000000000UL)
135 /* Slot 256: read-only guest-accessible machine-to-phys translation table. */
136 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
137 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + PML4_ENTRY_BYTES/2)
138 /* Slot 257: read-only guest-accessible linear page table. */
139 #define RO_LINEAR_PT_VIRT_START (RO_MPT_VIRT_END + PML4_ENTRY_BYTES/2)
140 #define RO_LINEAR_PT_VIRT_END (RO_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
141 /* Slot 258: linear page table (guest table). */
142 #define LINEAR_PT_VIRT_START (RO_LINEAR_PT_VIRT_END)
143 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
144 /* Slot 259: linear page table (shadow table). */
145 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
146 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + PML4_ENTRY_BYTES)
147 /* Slot 260: per-domain mappings. */
148 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
149 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + PML4_ENTRY_BYTES)
150 /* Slot 262-263: A direct 1:1 mapping of all of physical memory. */
151 #define DIRECTMAP_VIRT_START (PERDOMAIN_VIRT_END + PML4_ENTRY_BYTES)
152 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + PML4_ENTRY_BYTES*2)
154 #define PGT_base_page_table PGT_l4_page_table
156 #define __HYPERVISOR_CS64 0x0810
157 #define __HYPERVISOR_CS32 0x0808
158 #define __HYPERVISOR_DS 0x0818
160 /* For generic assembly code: use macros to define operation/operand sizes. */
161 #define __OS "q" /* Operation Suffix */
162 #define __OP "r" /* Operand Prefix */
164 #elif defined(__i386__)
166 #define XENHEAP_DEFAULT_MB (12)
167 #define DIRECTMAP_PHYS_END (40*1024*1024)
169 /* Hypervisor owns top 64MB of virtual address space. */
170 #define __HYPERVISOR_VIRT_START 0xFC000000
171 #define HYPERVISOR_VIRT_START (0xFC000000UL)
173 /*
174 * First 4MB are mapped read-only for all. It's for the machine->physical
175 * mapping table (MPT table). The following are virtual addresses.
176 */
177 #define RO_MPT_VIRT_START (HYPERVISOR_VIRT_START)
178 #define RO_MPT_VIRT_END (RO_MPT_VIRT_START + (4*1024*1024))
179 /* The virtual addresses for the 40MB direct-map region. */
180 #define DIRECTMAP_VIRT_START (RO_MPT_VIRT_END)
181 #define DIRECTMAP_VIRT_END (DIRECTMAP_VIRT_START + DIRECTMAP_PHYS_END)
182 #define XENHEAP_VIRT_START (DIRECTMAP_VIRT_START)
183 #define XENHEAP_VIRT_END (XENHEAP_VIRT_START + (XENHEAP_DEFAULT_MB<<20))
184 #define RDWR_MPT_VIRT_START (XENHEAP_VIRT_END)
185 #define RDWR_MPT_VIRT_END (RDWR_MPT_VIRT_START + (4*1024*1024))
186 #define FRAMETABLE_VIRT_START (RDWR_MPT_VIRT_END)
187 #define FRAMETABLE_VIRT_END (DIRECTMAP_VIRT_END)
188 /* Next 4MB of virtual address space is used as a linear p.t. mapping. */
189 #define LINEAR_PT_VIRT_START (DIRECTMAP_VIRT_END)
190 #define LINEAR_PT_VIRT_END (LINEAR_PT_VIRT_START + (4*1024*1024))
191 /* Next 4MB of virtual address space is used as a shadow linear p.t. map. */
192 #define SH_LINEAR_PT_VIRT_START (LINEAR_PT_VIRT_END)
193 #define SH_LINEAR_PT_VIRT_END (SH_LINEAR_PT_VIRT_START + (4*1024*1024))
194 /* Next 4MB of virtual address space used for per-domain mappings (eg. GDT). */
195 #define PERDOMAIN_VIRT_START (SH_LINEAR_PT_VIRT_END)
196 #define PERDOMAIN_VIRT_END (PERDOMAIN_VIRT_START + (4*1024*1024))
197 /* Penultimate 4MB of virtual address space used for domain page mappings. */
198 #define MAPCACHE_VIRT_START (PERDOMAIN_VIRT_END)
199 #define MAPCACHE_VIRT_END (MAPCACHE_VIRT_START + (4*1024*1024))
200 /* Final 4MB of virtual address space used for ioremap(). */
201 #define IOREMAP_VIRT_START (MAPCACHE_VIRT_END)
202 #define IOREMAP_VIRT_END (IOREMAP_VIRT_START + (4*1024*1024))
204 #define PGT_base_page_table PGT_l2_page_table
206 #define __HYPERVISOR_CS 0x0808
207 #define __HYPERVISOR_DS 0x0810
209 /* For generic assembly code: use macros to define operation/operand sizes. */
210 #define __OS "l" /* Operation Suffix */
211 #define __OP "e" /* Operand Prefix */
213 #endif /* __i386__ */
215 #ifndef __ASSEMBLY__
216 extern unsigned long xenheap_phys_end; /* user-configurable */
217 #endif
219 #define GDT_VIRT_START (PERDOMAIN_VIRT_START)
220 #define GDT_VIRT_END (GDT_VIRT_START + (64*1024))
221 #define LDT_VIRT_START (GDT_VIRT_END)
222 #define LDT_VIRT_END (LDT_VIRT_START + (64*1024))
224 #if defined(__x86_64__)
225 #define ELFSIZE 64
226 #else
227 #define ELFSIZE 32
228 #endif
230 #endif /* __XEN_I386_CONFIG_H__ */