Mailing List Archive

[xen-unstable] Intel VT-D: Don't turn x2APIC if there is a missing DRHD entry for the IOAPIC.
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1268157491 0
# Node ID 3198a2e81d383783e675cb49854255c87ab3e7c5
# Parent bfaafdddf31a1c3988a7bb39a045f950e38a8cbf
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>
---
xen/drivers/passthrough/vtd/intremap.c | 6 ++++++
1 files changed, 6 insertions(+)

diff -r bfaafdddf31a -r 3198a2e81d38 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c Tue Mar 09 17:53:01 2010 +0000
+++ b/xen/drivers/passthrough/vtd/intremap.c Tue Mar 09 17:58:11 2010 +0000
@@ -127,9 +127,15 @@ int iommu_supports_eim(void)
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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog