From owner-freebsd-smp Fri May 5 13: 7:37 2000 Delivered-To: freebsd-smp@freebsd.org Received: from chopper.Poohsticks.ORG (chopper.poohsticks.org [63.227.60.73]) by hub.freebsd.org (Postfix) with SMTP id A360637BC41 for ; Fri, 5 May 2000 13:07:34 -0700 (PDT) (envelope-from drew@chopper.Poohsticks.ORG) Received: from chopper.Poohsticks.ORG (localhost.poohsticks.org [127.0.0.1]) by chopper.Poohsticks.ORG (8.6.12/8.6.6) with ESMTP id OAA28764 for ; Fri, 5 May 2000 14:07:33 -0600 Message-Id: <200005052007.OAA28764@chopper.Poohsticks.ORG> To: freebsd-smp@freebsd.org Subject: T_RESERVED prevention kludge MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28761.957557253.1@chopper.Poohsticks.ORG> Date: Fri, 05 May 2000 14:07:33 -0600 From: Drew Eckhardt Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following is against 4.0 stable, and includes Tor.Egge@fast.no's mask unused APIC pins patch. Before, half the time I couldn't build a kernel before I paniced. Now, I can survive five make buildworld -j 5s. Index: mpapic.c =================================================================== RCS file: /usr/local/cvs/src/sys/i386/i386/mpapic.c,v retrieving revision 1.37 diff -u -r1.37 mpapic.c --- mpapic.c 1999/12/15 19:17:08 1.37 +++ mpapic.c 2000/05/05 19:08:45 @@ -168,6 +168,27 @@ for (pin = 0; pin < maxpin; ++pin) { int bus, bustype, irq; + select = pin * 2 + IOAPIC_REDTBL0; /* register */ + /* + * Always disable interrupts, and by default map + * pin X to IRQX because the disable doesn't stick + * and the uninitialize vector will get translated + * into a panic. + * + * This is correct for IRQs 1 and 3-15. In the other cases, + * any robust driver will handle the spurious interrupt, and + * the effective NOP beats a panic. + * + * A dedicated "bogus interrupt" entry in the IDT would + * be a nicer hack, although some one should find out + * why some systems are generating interrupts when they + * shouldn't and stop the carnage. + */ + vector = NRSVIDT + pin; /* IDT vec */ + io_apic_write(apic, select, + (io_apic_read(apic, select) & ~IOART_INTMASK + & ~0xff)|IOART_INTMSET|vector); + /* we only deal with vectored INTs here */ if (apic_int_type(apic, pin) != 0) continue; @@ -209,7 +230,6 @@ if (apic != 0 || pin != irq) printf("IOAPIC #%d intpin %d -> irq %d\n", apic, pin, irq); - select = pin * 2 + IOAPIC_REDTBL0; /* register */ vector = NRSVIDT + irq; /* IDT vec */ io_apic_write(apic, select, flags | vector); io_apic_write(apic, select + 1, target); -- Home Page For those who do, no explanation is necessary. For those who don't, no explanation is possible. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message