From: "Jan Beulich" Subject: [PATCH] x86-64 linux: eliminate idt_table Date: Wed, 15 Feb 2006 17:03:51 +0100 Message-ID: <43F35EF7.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part7F5DC2F7.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part7F5DC2F7.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline idt_table is meaningless in paravirtualized guests, but there were still a couple of references to it left. The easiest way to locate them was to get rid of the variable altogether. It depends on the previously submitted patch cleaning up head.S (which, among other things, eliminated early_idt_handler). It also fixes the non-Xen cpu_gdt_init() handling (for easier later merging). Jan --=__Part7F5DC2F7.0__= Content-Type: text/plain; name="xenlinux-x86_64-no-idt_table.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xenlinux-x86_64-no-idt_table.patch" 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) { --=__Part7F5DC2F7.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part7F5DC2F7.0__=--