ia64/xen-unstable

changeset 8938:9bf99522ce5e

Eliminate x86_64 idt_table.
Add CONFIG_X86_NO_IDT to exclude all code which references the idt table.
Also fix the non-Xen cpu_gdt_init() handling.

From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Feb 20 17:32:29 2006 +0000 (2006-02-20)
parents f572c467d9c3
children 0e9a0a469c6b
files linux-2.6-xen-sparse/arch/x86_64/Kconfig linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/Kconfig	Mon Feb 20 17:22:00 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/Kconfig	Mon Feb 20 17:32:29 2006 +0000
     1.3 @@ -130,6 +130,11 @@ config X86_NO_TSS
     1.4  	depends on X86_64_XEN
     1.5  	default y
     1.6  
     1.7 +config X86_NO_IDT
     1.8 +	bool
     1.9 +	depends on X86_64_XEN
    1.10 +	default y
    1.11 +
    1.12  #
    1.13  # Define implied options from the CPU selection here
    1.14  #
     2.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S	Mon Feb 20 17:22:00 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S	Mon Feb 20 17:32:29 2006 +0000
     2.3 @@ -129,14 +129,6 @@ gdt_end:
     2.4  	/* zero the remaining page */
     2.5  	.fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0
     2.6  
     2.7 -	.section .bss, "aw", @nobits
     2.8 -	.align L1_CACHE_BYTES
     2.9 -ENTRY(idt_table)	
    2.10 -	.rept   256
    2.11 -	.quad   0
    2.12 -	.quad 	0
    2.13 -	.endr
    2.14 -
    2.15  /*
    2.16   * __xen_guest information
    2.17   */
     3.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c	Mon Feb 20 17:22:00 2006 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c	Mon Feb 20 17:32:29 2006 +0000
     3.3 @@ -40,7 +40,9 @@ cpumask_t cpu_initialized __cpuinitdata 
     3.4  struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly;
     3.5  struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned;
     3.6  
     3.7 +#ifndef CONFIG_X86_NO_IDT
     3.8  struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 
     3.9 +#endif
    3.10  
    3.11  char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
    3.12  
    3.13 @@ -155,13 +157,7 @@ static void switch_pt(void)
    3.14  
    3.15  void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
    3.16  {
    3.17 -#ifdef CONFIG_SMP
    3.18 -	int cpu = stack_smp_processor_id();
    3.19 -#else
    3.20 -	int cpu = smp_processor_id();
    3.21 -#endif
    3.22 -
    3.23 -	asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
    3.24 +	asm volatile("lgdt %0" :: "m" (*gdt_descr));
    3.25  	asm volatile("lidt %0" :: "m" (idt_descr));
    3.26  }
    3.27  #endif
    3.28 @@ -285,12 +281,7 @@ void __cpuinit cpu_init (void)
    3.29  #endif
    3.30  
    3.31  	cpu_gdt_descr[cpu].size = GDT_SIZE;
    3.32 -#ifndef CONFIG_XEN 
    3.33 - 	asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
    3.34 - 	asm volatile("lidt %0" :: "m" (idt_descr));
    3.35 -#else
    3.36  	cpu_gdt_init(&cpu_gdt_descr[cpu]);
    3.37 -#endif
    3.38  
    3.39  	memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
    3.40  	syscall_init();
     4.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c	Mon Feb 20 17:22:00 2006 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c	Mon Feb 20 17:32:29 2006 +0000
     4.3 @@ -47,7 +47,9 @@
     4.4  #include <asm/proto.h>
     4.5  #include <asm/nmi.h>
     4.6  
     4.7 +#ifndef CONFIG_X86_NO_IDT
     4.8  extern struct gate_struct idt_table[256]; 
     4.9 +#endif
    4.10  
    4.11  asmlinkage void divide_error(void);
    4.12  asmlinkage void debug(void);
    4.13 @@ -986,10 +988,6 @@ void __init trap_init(void)
    4.14                  printk("HYPERVISOR_set_trap_table faild: error %d\n",
    4.15                         ret);
    4.16  
    4.17 -#ifdef CONFIG_IA32_EMULATION
    4.18 -	set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
    4.19 -#endif
    4.20 -       
    4.21  	/*
    4.22  	 * Should be a barrier for any external CPU state.
    4.23  	 */
     5.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h	Mon Feb 20 17:22:00 2006 +0000
     5.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h	Mon Feb 20 17:32:29 2006 +0000
     5.3 @@ -90,7 +90,9 @@ static inline void clear_LDT(void)
     5.4   * something other than this.
     5.5   */
     5.6  extern struct desc_struct default_ldt[];
     5.7 +#ifndef CONFIG_X86_NO_IDT
     5.8  extern struct gate_struct idt_table[]; 
     5.9 +#endif
    5.10  extern struct desc_ptr cpu_gdt_descr[];
    5.11  
    5.12  /* the cpu gdt accessor */
    5.13 @@ -113,6 +115,7 @@ static inline void _set_gate(void *adr, 
    5.14  	memcpy(adr, &s, 16); 
    5.15  } 
    5.16  
    5.17 +#ifndef CONFIG_X86_NO_IDT
    5.18  static inline void set_intr_gate(int nr, void *func) 
    5.19  { 
    5.20  	BUG_ON((unsigned)nr > 0xFF);
    5.21 @@ -135,6 +138,7 @@ static inline void set_system_gate_ist(i
    5.22  {
    5.23  	_set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist);
    5.24  }
    5.25 +#endif
    5.26  
    5.27  static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, 
    5.28  					 unsigned size)