debuggers.hg

changeset 21066:3198a2e81d38

Intel VT-D: Don't turn x2APIC if there is a missing DRHD entry for the IOAPIC.

Follow the Linux kernel lead in which the x2APIC is only turned on
only if there is an DRHD entry for all IOAPICs in the system. If we
don't do this we might enable x2APIC and see various devices not
covered by the IOAPIC mentioned in DRHD, not receive any interrupts.


From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 17:58:11 2010 +0000 (2010-03-09)
parents bfaafdddf31a
children b4a1832a916f
files xen/drivers/passthrough/vtd/intremap.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/intremap.c	Tue Mar 09 17:53:01 2010 +0000
     1.2 +++ b/xen/drivers/passthrough/vtd/intremap.c	Tue Mar 09 17:58:11 2010 +0000
     1.3 @@ -127,10 +127,16 @@ static void set_ioapic_source_id(int api
     1.4  int iommu_supports_eim(void)
     1.5  {
     1.6      struct acpi_drhd_unit *drhd;
     1.7 +    int apic;
     1.8  
     1.9      if ( !iommu_enabled || !iommu_qinval || !iommu_intremap )
    1.10          return 0;
    1.11  
    1.12 +    /* We MUST have a DRHD unit for each IOAPIC. */
    1.13 +    for ( apic = 0; apic < nr_ioapics; apic++ )
    1.14 +        if ( !ioapic_to_iommu(IO_APIC_ID(apic)) )
    1.15 +            return 0;
    1.16 +
    1.17      if ( list_empty(&acpi_drhd_units) )
    1.18          return 0;
    1.19