Re: 2.1.63 - testing Pentium bug workaround..

Ingo Molnar (mingo@pc7537.hil.siemens.at)
Thu, 13 Nov 1997 15:28:07 +0100 (MET)


On Thu, 13 Nov 1997, David Whysong wrote:

> I just tried it on my newly-compiled SMP 2.1.63 with the extra patch you
> posted, and it does NOT fix the F00F lockup for me.

i suppose you have to apply David Woodhouse's patch too, to make the fix
work on _real_ SMP systems too. Does this fix your problems?

-- mingo

--- linux/arch/i386/kernel/smp.c.orig Thu Nov 13 02:39:01 1997
+++ linux/arch/i386/kernel/smp.c Thu Nov 13 03:44:15 1997
@@ -644,6 +644,7 @@
static int cpucount = 0;

extern int cpu_idle(void * unused);
+extern struct f00fbug_idt_struct idt_d;

/*
* Activate a secondary processor.
@@ -651,6 +652,9 @@
__initfunc(int start_secondary(void *unused))
{
smp_callin();
+ if (boot_cpu_data.f00f_bug) {
+ __asm__ __volatile__("\tlidt %0": "=m" (idt_d));
+ }
while (!smp_commenced)
barrier();
return cpu_idle(NULL);
--- linux/arch/i386/kernel/traps.c.orig Thu Nov 13 03:11:19 1997
+++ linux/arch/i386/kernel/traps.c Thu Nov 13 03:41:40 1997
@@ -411,13 +411,7 @@

#endif /* CONFIG_MATH_EMULATION */

-static struct
-{
- short limit __attribute__((packed));
- void * addr __attribute__((packed));
- short __pad __attribute__((packed));
-} idt_d;
-
+struct f00fbug_idt_struct idt_d;
void * idt2;

__initfunc(void trap_init_f00f_bug(void))
--- linux/include/asm-i386/processor.h.orig Thu Nov 13 03:29:48 1997
+++ linux/include/asm-i386/processor.h Thu Nov 13 03:29:52 1997
@@ -216,4 +216,10 @@
#define init_task (init_task_union.task)
#define init_stack (init_task_union.stack)

+struct f00fbug_idt_struct {
+ short limit __attribute__((packed));
+ void * addr __attribute__((packed));
+ short __pad __attribute__((packed));
+};
+
#endif /* __ASM_I386_PROCESSOR_H */