diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-03-09 17:58:11 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-03-09 17:58:11 +0000 |
commit | 17795caf52a78c773e7ba5b914bb0579766f146a (patch) | |
tree | 976ac23ce79d53cf4652e905fd43ebe090750680 | |
parent | fcd0e226300c0bb0917fdf7c464157f31ab3b1be (diff) | |
download | xen-17795caf52a78c773e7ba5b914bb0579766f146a.tar.gz xen-17795caf52a78c773e7ba5b914bb0579766f146a.tar.bz2 xen-17795caf52a78c773e7ba5b914bb0579766f146a.zip |
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>
-rw-r--r-- | xen/drivers/passthrough/vtd/intremap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 9459a81736..0b3d95827b 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -127,10 +127,16 @@ static void set_ioapic_source_id(int apic_id, struct iremap_entry *ire) int iommu_supports_eim(void) { struct acpi_drhd_unit *drhd; + int apic; if ( !iommu_enabled || !iommu_qinval || !iommu_intremap ) return 0; + /* We MUST have a DRHD unit for each IOAPIC. */ + for ( apic = 0; apic < nr_ioapics; apic++ ) + if ( !ioapic_to_iommu(IO_APIC_ID(apic)) ) + return 0; + if ( list_empty(&acpi_drhd_units) ) return 0; |