]> git.hungrycats.org Git - linux/commitdiff
[PATCH] f00f workaround update, TLS, 2.5.28
authorIngo Molnar <mingo@elte.hu>
Fri, 26 Jul 2002 06:57:13 +0000 (23:57 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Fri, 26 Jul 2002 06:57:13 +0000 (23:57 -0700)
This updates the F00F bug workaround code to the IDT changes in the TLS
patch.

Tested it on a non-Pentium box on which i triggered the workaround
artificially.

arch/i386/kernel/head.S
arch/i386/kernel/traps.c
arch/i386/mm/fault.c

index 5726a79b6c1076f32534f5923ffebdec12d3fa77..3d2c11f0e5921e55f3812dd46028c804f3f2ddff 100644 (file)
@@ -348,6 +348,7 @@ ignore_int:
 .globl cpu_gdt_descr
 
        ALIGN
+       .word 0                         # 32-bit align idt_desc.address
 idt_descr:
        .word IDT_ENTRIES*8-1           # idt contains 256 entries
        .long idt_table
index 102effe6e2d193800a46456f6df39933bfaf5fe5..4338f4c60fa9ca76eef28613c19c4d62dd073a73 100644 (file)
@@ -784,11 +784,10 @@ void __init trap_init_f00f_bug(void)
        __set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
 
        /*
-        * "idt" is magic - it overlaps the idt_descr
-        * variable so that updating idt will automatically
-        * update the idt descriptor..
+        * Update the IDT descriptor and reload the IDT so that
+        * it uses the read-only mapped virtual address.
         */
-       idt = (struct desc_struct *) fix_to_virt(FIX_F00F_IDT);
+       idt_descr.address = fix_to_virt(FIX_F00F_IDT);
        __asm__ __volatile__("lidt %0": "=m" (idt_descr));
 }
 #endif
index 8c4328690ebebb75892512e6b27a4cfe7ea65716..cd4083d09658edf14151ff290276da3d190bd6b7 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
 #include <asm/hardirq.h>
+#include <asm/desc.h>
 
 extern void die(const char *,struct pt_regs *,long);
 
@@ -129,7 +130,6 @@ void bust_spinlocks(int yes)
 }
 
 asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
-extern unsigned long idt;
 
 /*
  * This routine handles page faults.  It determines the address,
@@ -293,7 +293,7 @@ bad_area:
        if (boot_cpu_data.f00f_bug) {
                unsigned long nr;
                
-               nr = (address - idt) >> 3;
+               nr = (address - idt_descr.address) >> 3;
 
                if (nr == 6) {
                        do_invalid_op(regs, 0);