io_apic: Support APIC Extended Destination IDs
If APIC Extended Destination ID support is enabled, use it in APIC RTEs by allowing APIC IDs up to 2^15 - 1 and encoding the high bits into Intel "reserved" bits per the standard. Reviewed by: kib MFC after: 3 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55889
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -371,6 +371,13 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
||||
low = IOART_DESTPHY;
|
||||
high = intpin->io_cpu << APIC_ID_SHIFT;
|
||||
intpin->io_valid = 1;
|
||||
} 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;
|
||||
intpin->io_valid = 1;
|
||||
} else {
|
||||
printf("%s: unsupported destination APIC ID %u for pin %u\n",
|
||||
__func__, intpin->io_cpu, intpin->io_intpin);
|
||||
|
||||
Reference in New Issue
Block a user