Re: 2.0.32pre4 works!!!

Hans Lermen (lermen@elserv.ffm.fgan.de)
Fri, 14 Nov 1997 15:58:34 +0100 (MET)


On Fri, 14 Nov 1997, Frank Sweetser wrote:

> ==> Regarding 2.0.32pre4 works!!!; Frank Sweetser <rasmusin@WPI.EDU> adds:
>
> rasmusin> success!! 2.0.32pre4 defends agains the f00f bug! doing
>
> Yep... works for me with SMP enabled, as well.
^^^^^^^^^^^^^^^^
hmm, on _my_ SMP-box it needs the below patch to work correctly _and_ to
detect/activate the 2nd CPU (a 'cat /proc/cpuinfo' tells you the truth).

Hans
<lermen@fgan.de>

--- ../linux-pre-2.0.32-4-clean/arch/i386/kernel/traps.c Fri Nov 14 10:10:13 1997
+++ arch/i386/kernel/traps.c Fri Nov 14 12:28:33 1997
@@ -338,6 +338,10 @@
#endif /* CONFIG_MATH_EMULATION */

struct desc_struct *idt = __idt+0;
+struct {
+ unsigned short limit;
+ unsigned long addr __attribute__((packed));
+} idt_descriptor;

void trap_init_f00f_bug(void)
{
@@ -346,10 +350,6 @@
pte_t * pte;
unsigned long twopage;
struct desc_struct *new_idt;
- struct {
- unsigned short limit;
- unsigned long addr __attribute__((packed));
- } idt_descriptor;

printk("moving IDT ... ");

--- ../linux-pre-2.0.32-4-clean/arch/i386/kernel/smp.c Fri Oct 24 11:34:13 1997
+++ arch/i386/kernel/smp.c Fri Nov 14 14:46:46 1997
@@ -537,7 +537,13 @@
extern void calibrate_delay(void);
int cpuid=GET_APIC_ID(apic_read(APIC_ID));
unsigned long l;
+ extern struct desc_struct idt_descriptor;
+ extern int pentium_f00f_bug;

+ if (pentium_f00f_bug) {
+ __asm__ __volatile__("\tlidt %0": "=m" (idt_descriptor));
+ }
+
/*
* Activate our APIC
*/