direct-io.hg

changeset 4912:5020295d041d

bitkeeper revision 1.1407 (42851a62m3iGb_ScYjvXzomQNk1N4Q)

desc.h, process.c:
[PATCH] Fixing TLS handling in x86-64 xenlinux
Some LTP testcases (pthreads) have exposed this bug (kill the kernel),
and the attached fixes the problem. With this, pth_str0? run fine, for
example. We'll continue to run LTP on x86-64 xenlinux to get all of them
pass.
Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri May 13 21:21:38 2005 +0000 (2005-05-13)
parents 85b71d470051
children 0651c17c1f17
files linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c	Fri May 13 19:27:55 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c	Fri May 13 21:21:38 2005 +0000
     1.3 @@ -247,6 +247,7 @@ static inline void set_32bit_tls(struct 
     1.4  	struct user_desc ud = { 
     1.5  		.base_addr = addr,
     1.6  		.limit = 0xfffff,
     1.7 +		.contents = (3 << 3), /* user */
     1.8  		.seg_32bit = 1,
     1.9  		.limit_in_pages = 1,
    1.10  		.useable = 1,
    1.11 @@ -401,8 +402,7 @@ struct task_struct *__switch_to(struct t
    1.12  		mcl->op      = __HYPERVISOR_update_descriptor;		\
    1.13  		mcl->args[0] = virt_to_machine(&get_cpu_gdt_table(cpu)	\
    1.14  					       [GDT_ENTRY_TLS_MIN + i]); \
    1.15 -		mcl->args[1] = (unsigned long) ((u64 *) &next->tls_array[i]); \
    1.16 -		mcl->args[2] = (unsigned long) ((u64 *) &next->tls_array[i]); \
    1.17 +		mcl->args[1] = next->tls_array[i];			\
    1.18  		mcl++;							\
    1.19  	}								\
    1.20  } while (0)
     2.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h	Fri May 13 19:27:55 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h	Fri May 13 21:21:38 2005 +0000
     2.3 @@ -65,9 +65,9 @@ struct desc_ptr {
     2.4  
     2.5  extern struct desc_ptr idt_descr, cpu_gdt_descr[NR_CPUS];
     2.6  
     2.7 -extern struct desc_ptr cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
     2.8 +extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
     2.9  
    2.10 -#define get_cpu_gdt_table(_cpu) ((struct desc_ptr *)(cpu_gdt_descr[(_cpu)].address))
    2.11 +#define get_cpu_gdt_table(_cpu) ((struct desc_struct *)(cpu_gdt_descr[(_cpu)].address))
    2.12  
    2.13  #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
    2.14  #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))