Allow 'options SMP' *WITHOUT* 'options APIC_IO'. That is, an ability to
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 4 Nov 2005 08:57:31 +0000 (08:57 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 4 Nov 2005 08:57:31 +0000 (08:57 +0000)
commit97359a5b0b92aa9a72ff61c2b7d311476fb9dcdf
treefda67610fad6de17497ee2a1a4fdbdf66615a4ef
parent82b857c9c4b86b3ca1ced263759854b2e542302f
Allow 'options SMP' *WITHOUT* 'options APIC_IO'.  That is, an ability to
produce an SMP-capable kernel that uses the PIC/ICU instead of the IO APICs
for interrupt routing.

SMP boxes with broken BIOSes (namely my Shuttle XPC SN95G5) could very well
have serious interrupt routing problems when operating in IO APIC mode.
One solution is to not use the IO APICs.  That is, to run only the Local
APICs for the SMP management.

* Don't conditionalize NIDT.  Just set it to 256

* Make the ICU interrupt code MP SAFE.  This primarily means using the
  imen_spinlock to protect accesses to icu_imen.

* When running SMP without APIC_IO, set the LAPIC TPR to prevent unintentional
  interrupts.  Leave LINT0 enabled (normally with APIC_IO LINT0 is disabled
  when the IO APICs are activated).  LINT0 is the virtual wire between the
  8259 and LAPIC 0.

* Get rid of NRSVIDT.  Just use IDT_OFFSET instead.

* Clean up all the APIC_IO tests which should have been SMP tests, and all
  the SMP tests which should have been APIC_IO tests.  Explicitly #ifdef
  out all code related to the IO APICs when APIC_IO is not set.
60 files changed:
sys/amd64/include/segments.h
sys/bus/pci/i386/pci_cfgreg.c
sys/bus/pci/pci.c
sys/bus/pci/pci_compat.c
sys/config/GENERIC
sys/cpu/i386/include/segments.h
sys/i386/apic/apic_ipl.h
sys/i386/apic/apic_ipl.s
sys/i386/apic/apic_vector.s
sys/i386/apic/mpapic.c
sys/i386/apic/mpapic.h
sys/i386/conf/GENERIC
sys/i386/i386/autoconf.c
sys/i386/i386/globals.s
sys/i386/i386/machdep.c
sys/i386/i386/mp_machdep.c
sys/i386/i386/nexus.c
sys/i386/i386/pmap.c
sys/i386/i386/pmap_inval.c
sys/i386/i386/sys_machdep.c
sys/i386/i386/tls.c
sys/i386/i386/trap.c
sys/i386/i386/vm_machdep.c
sys/i386/icu/icu_abi.c
sys/i386/icu/icu_ipl.h
sys/i386/icu/icu_ipl.s
sys/i386/icu/icu_vector.s
sys/i386/include/ipl.h
sys/i386/include/segments.h
sys/i386/include/smp.h
sys/i386/isa/clock.c
sys/i386/isa/intr_machdep.c
sys/i386/isa/intr_machdep.h
sys/i386/isa/npx.c
sys/platform/pc32/apic/apic_ipl.h
sys/platform/pc32/apic/apic_ipl.s
sys/platform/pc32/apic/apic_vector.s
sys/platform/pc32/apic/mpapic.c
sys/platform/pc32/apic/mpapic.h
sys/platform/pc32/i386/autoconf.c
sys/platform/pc32/i386/globals.s
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/nexus.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/i386/pmap_inval.c
sys/platform/pc32/i386/sys_machdep.c
sys/platform/pc32/i386/tls.c
sys/platform/pc32/i386/trap.c
sys/platform/pc32/i386/vm_machdep.c
sys/platform/pc32/icu/icu_abi.c
sys/platform/pc32/icu/icu_ipl.h
sys/platform/pc32/icu/icu_ipl.s
sys/platform/pc32/icu/icu_vector.s
sys/platform/pc32/include/ipl.h
sys/platform/pc32/include/smp.h
sys/platform/pc32/isa/clock.c
sys/platform/pc32/isa/intr_machdep.c
sys/platform/pc32/isa/intr_machdep.h
sys/platform/pc32/isa/npx.c