2.1.120 broken on P5 SMP machines + fix

Thomas Bogendoerfer (tsbogend@alpha.franken.de)
Sat, 5 Sep 1998 13:03:00 +0200


As predicted 2.1.120 is broken on P5 SMP machines, because of the
order change of smp_begin() and check_bugs() in init/main.c. I guess
it was Linus intend to break it (see my signature) to get a better fix
for the P5 SMP problem (and to fix the f00f_bug detection of course).
Below is a patch, which made 2.1.120 working on my P5 SMP system.

Thomas.

Index: arch/i386/kernel/irq.c
===================================================================
RCS file: /usr/src/cvs/linux/arch/i386/kernel/irq.c,v
retrieving revision 1.1.1.44
diff -u -r1.1.1.44 irq.c
--- irq.c 1998/09/05 09:28:05 1.1.1.44
+++ irq.c 1998/09/05 11:01:35
@@ -1020,9 +1020,32 @@
__initfunc(void init_IRQ_SMP(void))
{
int i;
+ pgd_t * pgd;
+ pmd_t * pmd;
+ pte_t * pte;
+
+ /*
+ * we need to make the idt writeable
+ * on Pentium systems, if the f00f_bug
+ * workaroung is enabled
+ */
+ if (boot_cpu_data.f00f_bug) {
+ pgd = pgd_offset(&init_mm, (unsigned long)idt);
+ pmd = pmd_offset(pgd, (unsigned long)idt);
+ pte = pte_offset(pmd, (unsigned long)idt);
+ *pte = pte_mkwrite(*pte);
+ local_flush_tlb();
+ }
+
for (i = 0; i < NR_IRQS ; i++)
if (IO_APIC_VECTOR(i) > 0)
set_intr_gate(IO_APIC_VECTOR(i), interrupt[i]);
+
+ /* make idt readonly again */
+ if (boot_cpu_data.f00f_bug) {
+ *pte = pte_wrprotect(*pte);
+ local_flush_tlb();
+ }
}

#endif

-- 
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
                   [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html