NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/43568: Need to ignore un-responsive ioapic



>Number:         43568
>Category:       kern
>Synopsis:       Need to ignore un-responsive ioapic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 04 12:45:00 +0000 2010
>Originator:     Paul Goyette
>Release:        NetBSD 5.99.31
>Organization:
-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------
>Environment:
        
        
System: NetBSD quicky.whooppee.com 5.99.31 NetBSD 5.99.31 (QUICKY (XFX nForce 
790i ULTRA) 2010-06-20 00:30:00) #0: Sat Jun 19 18:19:27 PDT 2010 
paul%speedy.whooppee.com@localhost:/build-out/netbsd-local/obj/amd64/sys/arch/amd64/compile/QUICKY
 amd64
Architecture: x86_64
Machine: amd64
>Description:
        Some BIOS report ioapic devices that don't actually exist.  We
        should ignore these, as is done on other xxxBSD systems.
>How-To-Repeat:
        One example where this happens is on a SuperMmicro server board
        H8QGi-F.
>Fix:
        The following patch detects the non-existence of the ioapic (by
        checking the return value of the read size/version register) and
        does not add the device to internal tables if it is not present.


Index: ioapic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/ioapic.c,v
retrieving revision 1.44
diff -u -p -r1.44 ioapic.c
--- ioapic.c    18 Aug 2009 16:41:03 -0000      1.44
+++ ioapic.c    3 Jul 2010 22:39:34 -0000
@@ -279,8 +279,6 @@ ioapic_attach(device_t parent, device_t 
                return;
        }
 
-       ioapic_add(sc);
-
        aprint_verbose(": pa 0x%jx", (uintmax_t)aaa->apic_address);
 #ifndef _IOAPIC_CUSTOM_RW
        {
@@ -308,7 +306,13 @@ ioapic_attach(device_t parent, device_t 
 
        apic_id = (ioapic_read(sc,IOAPIC_ID)&IOAPIC_ID_MASK)>>IOAPIC_ID_SHIFT;
        ver_sz = ioapic_read(sc, IOAPIC_VER);
-       
+       if (ver_sz == 0xffffffff) {
+               aprint_error(": failed to read version/size\n");
+               return;
+       }
+
+       ioapic_add(sc);
+
        sc->sc_apic_vers = (ver_sz & IOAPIC_VER_MASK) >> IOAPIC_VER_SHIFT;
        sc->sc_apic_sz = (ver_sz & IOAPIC_MAX_MASK) >> IOAPIC_MAX_SHIFT;
        sc->sc_apic_sz++;
@@ -329,8 +333,9 @@ ioapic_attach(device_t parent, device_t 
                    aaa->flags & IOAPIC_PICMODE ? "PIC" : "virtual wire");
        }
        
-       aprint_verbose(", version %x, %d pins", sc->sc_apic_vers,
-           sc->sc_apic_sz);
+       aprint_verbose(", version %x, %d pins, vector base %d (%d)",
+           sc->sc_apic_vers, sc->sc_apic_sz, sc->sc_pic.pic_vecbase,
+           aaa->apic_vecbase);
        aprint_normal("\n");
 
        sc->sc_pins = malloc(sizeof(struct ioapic_pin) * sc->sc_apic_sz,
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index