Index: head-2006-02-14/arch/x86_64/kernel/head-xen.S =================================================================== --- head-2006-02-14.orig/arch/x86_64/kernel/head-xen.S 2006-02-15 15:33:15.000000000 +0100 +++ head-2006-02-14/arch/x86_64/kernel/head-xen.S 2006-02-15 15:34:40.000000000 +0100 @@ -254,6 +254,7 @@ gdt_end: /* zero the remaining page */ .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0 +#ifndef CONFIG_XEN .section .bss, "aw", @nobits .align L1_CACHE_BYTES ENTRY(idt_table) @@ -261,4 +262,4 @@ ENTRY(idt_table) .quad 0 .quad 0 .endr - +#endif Index: head-2006-02-14/arch/x86_64/kernel/setup64-xen.c =================================================================== --- head-2006-02-14.orig/arch/x86_64/kernel/setup64-xen.c 2006-02-15 15:49:31.000000000 +0100 +++ head-2006-02-14/arch/x86_64/kernel/setup64-xen.c 2006-02-15 15:38:16.000000000 +0100 @@ -40,7 +40,9 @@ cpumask_t cpu_initialized __cpuinitdata struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly; struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned; +#ifndef CONFIG_XEN struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; +#endif char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); @@ -155,13 +157,7 @@ static void switch_pt(void) void __init cpu_gdt_init(struct desc_ptr *gdt_descr) { -#ifdef CONFIG_SMP - int cpu = stack_smp_processor_id(); -#else - int cpu = smp_processor_id(); -#endif - - asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu])); + asm volatile("lgdt %0" :: "m" (*gdt_descr)); asm volatile("lidt %0" :: "m" (idt_descr)); } #endif @@ -285,12 +281,7 @@ void __cpuinit cpu_init (void) #endif cpu_gdt_descr[cpu].size = GDT_SIZE; -#ifndef CONFIG_XEN - asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu])); - asm volatile("lidt %0" :: "m" (idt_descr)); -#else cpu_gdt_init(&cpu_gdt_descr[cpu]); -#endif memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8); syscall_init(); Index: head-2006-02-14/arch/x86_64/kernel/traps-xen.c =================================================================== --- head-2006-02-14.orig/arch/x86_64/kernel/traps-xen.c 2006-02-15 15:49:31.000000000 +0100 +++ head-2006-02-14/arch/x86_64/kernel/traps-xen.c 2006-02-15 15:39:19.000000000 +0100 @@ -47,8 +47,6 @@ #include #include -extern struct gate_struct idt_table[256]; - asmlinkage void divide_error(void); asmlinkage void debug(void); asmlinkage void nmi(void); @@ -986,10 +984,6 @@ void __init trap_init(void) printk("HYPERVISOR_set_trap_table faild: error %d\n", ret); -#ifdef CONFIG_IA32_EMULATION - set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall); -#endif - /* * Should be a barrier for any external CPU state. */ Index: head-2006-02-14/include/asm-x86_64/mach-xen/asm/desc.h =================================================================== --- head-2006-02-14.orig/include/asm-x86_64/mach-xen/asm/desc.h 2006-02-13 15:13:37.000000000 +0100 +++ head-2006-02-14/include/asm-x86_64/mach-xen/asm/desc.h 2006-02-15 15:50:43.000000000 +0100 @@ -90,7 +90,6 @@ static inline void clear_LDT(void) * something other than this. */ extern struct desc_struct default_ldt[]; -extern struct gate_struct idt_table[]; extern struct desc_ptr cpu_gdt_descr[]; /* the cpu gdt accessor */ @@ -113,29 +112,6 @@ static inline void _set_gate(void *adr, memcpy(adr, &s, 16); } -static inline void set_intr_gate(int nr, void *func) -{ - BUG_ON((unsigned)nr > 0xFF); - _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, 0); -} - -static inline void set_intr_gate_ist(int nr, void *func, unsigned ist) -{ - BUG_ON((unsigned)nr > 0xFF); - _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 0, ist); -} - -static inline void set_system_gate(int nr, void *func) -{ - BUG_ON((unsigned)nr > 0xFF); - _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, 0); -} - -static inline void set_system_gate_ist(int nr, void *func, unsigned ist) -{ - _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist); -} - static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, unsigned size) {