diff -burN linux-2.2.12.orig/arch/i386/kernel/io_apic.c linux-2.2.12/arch/i386/kernel/io_apic.c
--- linux-2.2.12.orig/arch/i386/kernel/io_apic.c        Mon Sep 27 08:56:32 1999
+++ linux-2.2.12/arch/i386/kernel/io_apic.c     Tue Dec 21 12:25:38 1999
@@ -1277,6 +1277,37 @@
       }
}

+/* Patch to set the IO-APIC physical IDs based on the values stored in the MPC table */
+/* by Matt Domsch <[email protected]>  Tue Dec 21 12:25:05 CST 1999 */
+
+static void __init setup_ioapic_ids_from_mpc(void)
+{
+       struct IO_APIC_reg_00 reg_00;
+       /*
+        * Set the IOAPIC ID to the value stored in the MPC table.
+        */
+       int apic;
+       for (apic = 0; apic < mp_apic_entries; apic++) {
+               /* Read the register 0 value */
+               *(int *)&reg_00 = io_apic_read(apic, 0);
+
+               if(reg_00.ID != mp_apics[apic].mpc_apicid) {
+                       /* Change the value */
+                       printk("...changing IO-APIC physical APIC ID to %d\n", mp_apics[apic].mpc_apicid);
+                       reg_00.ID = mp_apics[apic].mpc_apicid;
+                       io_apic_write(apic, 0, *(int *)&reg_00);
+
+                       /*
+                        * Sanity check
+                        */
+                       *(int *)&reg_00 = io_apic_read(apic, 0);
+                       if (reg_00.ID != mp_apics[apic].mpc_apicid)
+                               panic("could not set ID");
+               }
+       }
+}
+
+
/*
 *
 * IRQ's that are handled by the old PIC in all cases:
@@ -1336,9 +1368,11 @@
        * Set up the IO-APIC IRQ routing table by parsing the MP-BIOS
        * mptable:
        */
+       setup_ioapic_ids_from_mpc();
       setup_IO_APIC_irqs();
       init_IO_APIC_traps();
       check_timer();

       print_IO_APIC();
}
+