[PATCH] x86: bogus tls from gdt
authorZachary Amsden <zach@vmware.com>
Sun, 30 Oct 2005 22:59:33 +0000 (14:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:12 +0000 (17:37 -0800)
The per-CPU initialization code is copying in bogus data into
thread->tls_array.  Note that it copies &per_cpu(cpu_gdt_table, cpu), not
&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN).  That is totally broken
and unnecessary.  Make the initialization explicitly NULL.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/cpu/common.c

index 9ad43be9a01f0ebc2102f7d1fef5a11aa0146c71..a162c0326b4a3615e1504979d3c969c741108401 100644 (file)
@@ -607,12 +607,6 @@ void __devinit cpu_init(void)
        cpu_gdt_descr[cpu].address =
            (unsigned long)&per_cpu(cpu_gdt_table, cpu);
 
-       /*
-        * Set up the per-thread TLS descriptor cache:
-        */
-       memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
-               GDT_ENTRY_TLS_ENTRIES * 8);
-
        load_gdt(&cpu_gdt_descr[cpu]);
        load_idt(&idt_descr);