ia64/xen-unstable

view xen/include/asm-ia64/config.h @ 8908:f94931b07c67

[IA64] tlb miss fix

make dtlb miss handler to handle xen/ia64 identity mapping area.
xen/ia64 enables vhpt walker for all regions unlink Linux.
So dtlb misses on identity mapping area are catched by
dtlb miss handler, not alt dltb miss handler.

- dtlb miss on identity mapping area must be handled
- alt dtlb miss must be handled
- itlb miss on the identity mapping area must not occur
panic via page_fault().
- alt itlb miss by a guest must be handled
it occurs during dom0 boot.
- alt itlb miss by xen must not occur
panic by FORCE_CRASH

vmx_ivt.S already has such tweaks by checking psr.vm bit.

TODO: optimization
dtlb miss handlers are performance critical so that
it should be heavily optimized like alt_dtlb_miss.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Fri Feb 24 08:34:11 2006 -0700 (2006-02-24)
parents ded14681ae84
children a2bb5a3242a1
line source
1 #ifndef _IA64_CONFIG_H_
2 #define _IA64_CONFIG_H_
4 #undef USE_PAL_EMULATOR
5 // control flags for turning on/off features under test
6 #undef DOMU_BUILD_STAGING
7 #define VHPT_GLOBAL
9 #undef DEBUG_PFMON
11 // manufactured from component pieces
13 // defined in linux/arch/ia64/defconfig
14 //#define CONFIG_IA64_GENERIC
15 #define CONFIG_IA64_HP_SIM
16 #define CONFIG_IA64_L1_CACHE_SHIFT 7
17 // needed by include/asm-ia64/page.h
18 #define CONFIG_IA64_PAGE_SIZE_16KB // 4KB doesn't work?!?
19 #define CONFIG_IA64_GRANULE_16MB
21 #define CONFIG_EFI_PCDP
22 #define CONFIG_SERIAL_SGI_L1_CONSOLE
24 #undef CONFIG_XEN_SMP
26 #ifdef CONFIG_XEN_SMP
27 #define CONFIG_SMP 1
28 #define NR_CPUS 8
29 #define CONFIG_NR_CPUS 8
30 #else
31 #undef CONFIG_SMP
32 #define NR_CPUS 1
33 #define CONFIG_NR_CPUS 1
34 #endif
35 //#define NR_CPUS 16
36 //#define CONFIG_NR_CPUS 16
37 //leave SMP for a later time
38 //#undef CONFIG_SMP
40 #define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
42 #ifndef __ASSEMBLY__
44 // can't find where this typedef was before?!?
45 // needed by include/asm-ia64/processor.h (and other places)
46 typedef int pid_t;
48 // now needed for xen/include/mm.h
49 typedef unsigned long paddr_t;
50 // from include/linux/kernel.h
51 #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
53 //////////////////////////////////////
55 #define FASTCALL(x) x // see linux/include/linux/linkage.h
56 #define fastcall // " "
58 #define watchdog_disable() ((void)0)
59 #define watchdog_enable() ((void)0)
60 // from linux/include/linux/types.h
61 #define CLEAR_BITMAP(name,bits) \
62 memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
64 // FIXME?: x86-ism used in xen/mm.h
65 #define LOCK_PREFIX
67 extern unsigned long xenheap_phys_end;
68 extern unsigned long xen_pstart;
69 extern unsigned long xenheap_size;
70 extern struct domain *dom0;
71 extern unsigned long dom0_start;
72 extern unsigned long dom0_size;
74 // from linux/include/linux/mm.h
75 extern struct page *mem_map;
77 // xen/include/asm/config.h
78 extern char _end[]; /* standard ELF symbol */
80 // linux/include/linux/compiler.h
81 #define __attribute_const__
82 #define __user
83 //#define __kernel
84 //#define __safe
85 #define __force
86 #define __chk_user_ptr(x) (void)0
87 //#define __chk_io_ptr(x) (void)0
88 //#define __builtin_warning(x, y...) (1)
89 //#define __acquires(x)
90 //#define __releases(x)
91 //#define __acquire(x) (void)0
92 //#define __release(x) (void)0
93 //#define __cond_lock(x) (x)
94 //#define __must_check
95 #define __deprecated
96 #ifndef RELOC_HIDE
97 # define RELOC_HIDE(ptr, off) \
98 ({ unsigned long __ptr; \
99 __ptr = (unsigned long) (ptr); \
100 (typeof(ptr)) (__ptr + (off)); })
101 #endif
103 // xen/include/asm/config.h
104 //#define HZ 1000
105 // FIXME SMP: leave SMP for a later time
106 #define barrier() __asm__ __volatile__("": : :"memory")
108 ///////////////////////////////////////////////////////////////
109 // xen/include/asm/config.h
110 // Natural boundary upon TR size to define xenheap space
111 #define XENHEAP_DEFAULT_MB (1 << (KERNEL_TR_PAGE_SHIFT - 20))
112 #define XENHEAP_DEFAULT_SIZE (1 << KERNEL_TR_PAGE_SHIFT)
113 #define ELFSIZE 64
115 ///////////////////////////////////////////////////////////////
117 // get rid of difficult circular include dependency
118 #define CMPXCHG_BUGCHECK(v)
119 #define CMPXCHG_BUGCHECK_DECL
121 // from include/asm-ia64/smp.h
122 #ifdef CONFIG_SMP
123 //#warning "Lots of things to fix to enable CONFIG_SMP!"
124 #endif
125 #define get_cpu() smp_processor_id()
126 #define put_cpu() do {} while(0)
128 // needed for common/dom0_ops.c until hyperthreading is supported
129 #ifdef CONFIG_SMP
130 extern int smp_num_siblings;
131 #else
132 #define smp_num_siblings 1
133 #endif
135 // from linux/include/linux/mm.h
136 struct page;
138 // function calls; see decl in xen/include/xen/sched.h
139 #undef free_task_struct
140 #undef alloc_task_struct
141 #define get_thread_info(v) alloc_thread_info(v)
143 // avoid redefining task_t in asm/thread_info.h
144 #define task_t struct domain
146 // avoid redefining task_struct in asm/current.h
147 #define task_struct vcpu
149 // linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c)
150 #define platform_inb __ia64_inb
151 #define platform_inw __ia64_inw
152 #define platform_inl __ia64_inl
153 #define platform_outb __ia64_outb
154 #define platform_outw __ia64_outw
155 #define platform_outl __ia64_outl
157 // FIXME: This just overrides a use in a typedef (not allowed in ia64,
158 // or maybe just in older gcc's?) used in timer.c but should be OK
159 // (and indeed is probably required!) elsewhere
160 #undef __cacheline_aligned
161 #undef ____cacheline_aligned
162 #undef ____cacheline_aligned_in_smp
163 #define __cacheline_aligned
164 #define __cacheline_aligned_in_smp
165 #define ____cacheline_aligned
166 #define ____cacheline_aligned_in_smp
167 #define ____cacheline_maxaligned_in_smp
169 #ifndef __ASSEMBLY__
170 #include "asm/types.h" // for u64
171 #endif
173 // warning: unless search_extable is declared, the return value gets
174 // truncated to 32-bits, causing a very strange error in privop handling
175 struct exception_table_entry;
177 const struct exception_table_entry *
178 search_extable(const struct exception_table_entry *first,
179 const struct exception_table_entry *last,
180 unsigned long value);
181 void sort_extable(struct exception_table_entry *start,
182 struct exception_table_entry *finish);
183 void sort_main_extable(void);
185 #if 0 /* Already defined in xen/lib.h */
186 #define printk printf
187 #endif
189 #undef __ARCH_IRQ_STAT
191 #define find_first_set_bit(x) (ffs(x)-1) // FIXME: Is this right???
193 // from include/asm-x86/*/uaccess.h
194 #define array_access_ok(addr,count,size) \
195 (likely(sizeof(count) <= 4) /* disallow 64-bit counts */ && \
196 access_ok(type,addr,count*size))
198 // see drivers/char/console.c
199 #ifndef VALIDATE_VT
200 #define OPT_CONSOLE_STR "com1"
201 #else
202 #define OPT_CONSOLE_STR "com2"
203 #endif
205 #define __nocast
207 // see include/asm-x86/atomic.h (different from standard linux)
208 #define _atomic_set(v,i) (((v).counter) = (i))
209 #define _atomic_read(v) ((v).counter)
210 #define atomic_compareandswap(old, new, v) ((atomic_t){ cmpxchg(v, _atomic_read(old), _atomic_read(new)) })
212 // see include/asm-ia64/mm.h, handle remaining page_info uses until gone
213 #define page_info page
215 // see common/keyhandler.c
216 #define nop() asm volatile ("nop 0")
218 // from include/linux/preempt.h (needs including from interrupt.h or smp.h)
219 #define preempt_enable() do { } while (0)
220 #define preempt_disable() do { } while (0)
222 // needed for include/xen/linuxtime.h
223 typedef s64 time_t;
224 typedef s64 suseconds_t;
226 // needed for include/linux/jiffies.h
227 typedef long clock_t;
229 // from include/linux/kernel.h, needed by jiffies.h
230 #define typecheck(type,x) \
231 ({ type __dummy; \
232 typeof(x) __dummy2; \
233 (void)(&__dummy == &__dummy2); \
234 1; \
235 })
237 // from include/linux/timex.h, needed by arch/ia64/time.c
238 #define TIME_SOURCE_CPU 0
240 // used in common code
241 #define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending)
243 // dup'ed from signal.h to avoid changes to includes
244 #define SA_SHIRQ 0x04000000
245 #define SA_INTERRUPT 0x20000000
247 // needed for setup.c
248 extern unsigned long loops_per_jiffy;
249 extern char saved_command_line[];
250 struct screen_info { };
251 #define seq_printf(a,b...) printf(b)
252 #define CONFIG_BLK_DEV_INITRD // needed to reserve memory for domain0
254 void dummy_called(char *function);
255 #define dummy() dummy_called(__FUNCTION__)
257 // these declarations got moved at some point, find a better place for them
258 extern int ht_per_core;
260 // xen/include/asm/config.h
261 /******************************************************************************
262 * config.h
263 *
264 * A Linux-style configuration list.
265 */
267 #ifndef __XEN_IA64_CONFIG_H__
268 #define __XEN_IA64_CONFIG_H__
270 #undef CONFIG_X86
272 #define CONFIG_MCKINLEY
274 #undef CONFIG_X86_LOCAL_APIC
275 #undef CONFIG_X86_IO_APIC
276 #undef CONFIG_X86_L1_CACHE_SHIFT
278 // this needs to be on to run on hp zx1 with more than 4GB
279 // it is hacked around for now though
280 //#define CONFIG_VIRTUAL_MEM_MAP
282 //#ifndef CONFIG_IA64_HP_SIM
283 // looks like this is hard to turn off for Xen
284 #define CONFIG_ACPI 1
285 #define CONFIG_ACPI_BOOT 1
286 //#endif
288 #define CONFIG_XEN_ATTENTION_KEY 1
289 #endif /* __ASSEMBLY__ */
290 #endif /* __XEN_IA64_CONFIG_H__ */
292 // needed for include/xen/smp.h
293 #ifdef CONFIG_SMP
294 #define raw_smp_processor_id() current->processor
295 #else
296 #define raw_smp_processor_id() 0
297 #endif
300 #ifndef __ASSEMBLY__
301 #include <linux/linkage.h>
302 #define FORCE_CRASH() asm("break.m 0;;");
303 #else
304 #define FORCE_CRASH break.m 0;;
305 #endif
307 #endif /* _IA64_CONFIG_H_ */