]> xenbits.xensource.com Git - xen.git/commitdiff
vt-d: disable for old chipset steppings with incompatible page table format.
authorKeir Fraser <keir@xensource.com>
Sun, 23 Sep 2007 11:55:50 +0000 (12:55 +0100)
committerKeir Fraser <keir@xensource.com>
Sun, 23 Sep 2007 11:55:50 +0000 (12:55 +0100)
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
xen/arch/x86/hvm/vmx/vtd/dmar.c
xen/arch/x86/hvm/vmx/vtd/dmar.h
xen/arch/x86/hvm/vmx/vtd/utils.c

index 784af118187e3a9ef116579f69251e096c31c85a..44ca487bdb4011914f34c6698dd887e6dec51621 100644 (file)
@@ -489,6 +489,13 @@ acpi_parse_dmar(unsigned long phys_addr, unsigned long size)
 int acpi_dmar_init(void)
 {
     extern int ioapic_ack_new;
+    int rc;
+
+    if (!vtd_enabled)
+        return -ENODEV;
+
+    if ((rc = vtd_hw_check()) != 0)
+        return rc;
 
     acpi_table_parse(ACPI_DMAR, acpi_parse_dmar);
 
@@ -499,8 +506,7 @@ int acpi_dmar_init(void)
     }
 
     /* Use fake-vector style of IOAPIC acknowledgement. */
-    if (vtd_enabled)
-        ioapic_ack_new = 0;
+    ioapic_ack_new = 0;
 
     return 0;
 }
index 4e66c6c88da5ee734b0ad738abc19879caf668bf..e6cdf62fab72a9f6aefc17eb2a91610c966fbe50 100644 (file)
@@ -87,4 +87,6 @@ struct acpi_ioapic_unit {
     }ioapic;
 };
 
+int vtd_hw_check(void);
+
 #endif // _DMAR_H_
index 8d575292c3e7a329c663af4fc6aff2f04002018c..fa907a544e4b6f98446cd277eaec16e6a968d8f6 100644 (file)
 #include <xen/mm.h>
 #include <xen/xmalloc.h>
 
+#define VTDPREFIX "[VT-D]" 
+#define INTEL   0x8086
+#define SEABURG 0x4000
+#define C_STEP  2
+
+int vtd_hw_check(void)
+{
+    u16 vendor, device;
+    u8 revision, stepping;
+
+    vendor   = read_pci_config_16(0, 0, 0, PCI_VENDOR_ID);
+    device   = read_pci_config_16(0, 0, 0, PCI_DEVICE_ID);
+    revision = read_pci_config_byte(0, 0, 0, PCI_REVISION_ID);
+    stepping = revision & 0xf;
+
+    if ( (vendor == INTEL) && (device == SEABURG) )
+    {
+        if ( stepping < C_STEP )
+        {
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "*** VT-d disabled - pre C0-step Seaburg found\n");
+            dprintk(XENLOG_WARNING VTDPREFIX,
+                    "***  vendor = %x device = %x revision = %x\n",
+                    vendor, device, revision);
+            vtd_enabled = 0;
+            return -ENODEV;
+        }
+    }
+    return 0;
+}
+
 #if defined(__x86_64__)
 void print_iommu_regs(struct acpi_drhd_unit *drhd)
 {