Commit 0e0dad87 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] f00f workaround update, TLS, 2.5.28

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.
parent d33c76ad
...@@ -348,6 +348,7 @@ ignore_int: ...@@ -348,6 +348,7 @@ ignore_int:
.globl cpu_gdt_descr .globl cpu_gdt_descr
ALIGN ALIGN
.word 0 # 32-bit align idt_desc.address
idt_descr: idt_descr:
.word IDT_ENTRIES*8-1 # idt contains 256 entries .word IDT_ENTRIES*8-1 # idt contains 256 entries
.long idt_table .long idt_table
......
...@@ -784,11 +784,10 @@ void __init trap_init_f00f_bug(void) ...@@ -784,11 +784,10 @@ void __init trap_init_f00f_bug(void)
__set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO); __set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO);
/* /*
* "idt" is magic - it overlaps the idt_descr * Update the IDT descriptor and reload the IDT so that
* variable so that updating idt will automatically * it uses the read-only mapped virtual address.
* update the idt descriptor..
*/ */
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)); __asm__ __volatile__("lidt %0": "=m" (idt_descr));
} }
#endif #endif
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/desc.h>
extern void die(const char *,struct pt_regs *,long); extern void die(const char *,struct pt_regs *,long);
...@@ -129,7 +130,6 @@ void bust_spinlocks(int yes) ...@@ -129,7 +130,6 @@ void bust_spinlocks(int yes)
} }
asmlinkage void do_invalid_op(struct pt_regs *, unsigned long); asmlinkage void do_invalid_op(struct pt_regs *, unsigned long);
extern unsigned long idt;
/* /*
* This routine handles page faults. It determines the address, * This routine handles page faults. It determines the address,
...@@ -293,7 +293,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) ...@@ -293,7 +293,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (boot_cpu_data.f00f_bug) { if (boot_cpu_data.f00f_bug) {
unsigned long nr; unsigned long nr;
nr = (address - idt) >> 3; nr = (address - idt_descr.address) >> 3;
if (nr == 6) { if (nr == 6) {
do_invalid_op(regs, 0); do_invalid_op(regs, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment