[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] desc.h, process.c:



ChangeSet 1.1407, 2005/05/13 22:21:38+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxx>
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 arch/xen/x86_64/kernel/process.c  |    4 ++--
 include/asm-xen/asm-x86_64/desc.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c 
b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c
--- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c  2005-05-13 
18:03:47 -04:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/kernel/process.c  2005-05-13 
18:03:47 -04:00
@@ -247,6 +247,7 @@
        struct user_desc ud = { 
                .base_addr = addr,
                .limit = 0xfffff,
+               .contents = (3 << 3), /* user */
                .seg_32bit = 1,
                .limit_in_pages = 1,
                .useable = 1,
@@ -401,8 +402,7 @@
                mcl->op      = __HYPERVISOR_update_descriptor;          \
                mcl->args[0] = virt_to_machine(&get_cpu_gdt_table(cpu)  \
                                               [GDT_ENTRY_TLS_MIN + i]); \
-               mcl->args[1] = (unsigned long) ((u64 *) &next->tls_array[i]); \
-               mcl->args[2] = (unsigned long) ((u64 *) &next->tls_array[i]); \
+               mcl->args[1] = next->tls_array[i];                      \
                mcl++;                                                  \
        }                                                               \
 } while (0)
diff -Nru a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h 
b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h
--- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h 2005-05-13 
18:03:47 -04:00
+++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/desc.h 2005-05-13 
18:03:47 -04:00
@@ -65,9 +65,9 @@
 
 extern struct desc_ptr idt_descr, cpu_gdt_descr[NR_CPUS];
 
-extern struct desc_ptr cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
+extern struct desc_struct cpu_gdt_table[NR_CPUS][GDT_ENTRIES];
 
-#define get_cpu_gdt_table(_cpu) ((struct desc_ptr 
*)(cpu_gdt_descr[(_cpu)].address))
+#define get_cpu_gdt_table(_cpu) ((struct desc_struct 
*)(cpu_gdt_descr[(_cpu)].address))
 
 #define load_TR_desc() asm volatile("ltr %w0"::"r" (GDT_ENTRY_TSS*8))
 #define load_LDT_desc() asm volatile("lldt %w0"::"r" (GDT_ENTRY_LDT*8))

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.