Page MenuHomeFreeBSD

D55889.id173778.diff
No OneTemporary

D55889.id173778.diff

diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -84,6 +84,7 @@
* to use that ID.
*/
#define IOAPIC_MAX_ID 0xff
+#define IOAPIC_MAX_EXT_ID 0x7fff
/* I/O Interrupts are used for external devices such as ISA, PCI, etc. */
#define APIC_IO_INTS (IDT_IO_INTS + 16)
diff --git a/sys/x86/x86/io_apic.c b/sys/x86/x86/io_apic.c
--- a/sys/x86/x86/io_apic.c
+++ b/sys/x86/x86/io_apic.c
@@ -269,7 +269,8 @@
mtx_lock_spin(&icu_lock);
if (intpin->io_masked) {
flags = intpin->io_lowreg & ~IOART_INTMASK;
- if (intpin->io_cpu > IOAPIC_MAX_ID) {
+ if ((intpin->io_cpu > IOAPIC_MAX_ID && apic_ext_dest_id != 1) ||
+ (intpin->io_cpu > IOAPIC_MAX_EXT_ID)) {
/*
* Can't route to desired CPU; keep masked in hardware
* despite request to enable.
@@ -374,6 +375,12 @@
if (intpin->io_cpu <= IOAPIC_MAX_ID) {
low = IOART_DESTPHY;
high = intpin->io_cpu << APIC_ID_SHIFT;
+ } else if (intpin->io_cpu <= IOAPIC_MAX_EXT_ID &&
+ apic_ext_dest_id == 1) {
+ low = IOART_DESTPHY;
+ high = intpin->io_cpu << APIC_ID_SHIFT & APIC_ID_MASK;
+ high |= (intpin->io_cpu >> 8) << APIC_EXT_ID_SHIFT
+ & APIC_EXT_ID_MASK;
} else {
printf("%s: unsupported destination APIC ID %u\n",
__func__, intpin->io_cpu);

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 21, 5:18 PM (15 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37043178
Default Alt Text
D55889.id173778.diff (1 KB)

Event Timeline