Author: marius
Date: Thu Dec 28 21:46:09 2017
New Revision: 327314
URL: https://svnweb.freebsd.org/changeset/base/327314
Log:
With the advent of interrupt remapping, Intel has repurposed bit 11
(now: Interrupt_Index[15]) and assigned the previously reserved bits
55:48 (Interrupt_Index[14:0] goes into 63:49 while Destination Field
used 63:56 and bit 48 now is Interrupt_Format) in the IO redirection
tables (see the VT-d specification, "5.1.5.1 I/OxAPIC Programming").
Thus, when not using interrupt remapping, ensure that all previously
reserved bits in the high part of the RTEs are zero instead of doing
a read-modify-write for their Destination Field bits only.
Otherwise, on machines based on Apollo Lake and its derivatives such
as Denverton, typically some of the previously preserved bits remain
set after boot when not employing interrupt remapping. The result is
that INTx interrupts are not getting delivered.
Note: With an AMD IOMMU, interrupt remapping apparently bypasses the
IO APIC altogether.
Submitted by: loos (modulo comment)
Reviewed by: jhb (modulo comment)
Modified:
head/sys/x86/x86/io_apic.c
Modified: head/sys/x86/x86/io_apic.c
==
--- head/sys/x86/x86/io_apic.c Thu Dec 28 21:35:53 2017(r327313)
+++ head/sys/x86/x86/io_apic.c Thu Dec 28 21:46:09 2017(r327314)
@@ -308,7 +308,7 @@ static void
ioapic_program_intpin(struct ioapic_intsrc *intpin)
{
struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
- uint32_t low, high, value;
+ uint32_t low, high;
#ifdef ACPI_DMAR
int error;
#endif
@@ -354,7 +354,11 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
}
#endif
- /* Set the destination. */
+ /*
+* Set the destination. Note that with Intel interrupt remapping,
+* the previously reserved bits 55:48 now have a purpose so ensure
+* these are zero.
+*/
low = IOART_DESTPHY;
high = intpin->io_cpu << APIC_ID_SHIFT;
@@ -392,10 +396,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
}
/* Write the values to the APIC. */
- value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
- value &= ~IOART_DEST;
- value |= high;
- ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value);
+ ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), high);
intpin->io_lowreg = low;
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"