[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vt-d: disable for old chipset steppings with incompatible page table format.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1190548550 -3600
# Node ID 4fdcea9881b24a76c23c8b12b12cf3b66cba4a33
# Parent  40d88481cd3f4abc01053508b9c9290e5aa9662e
vt-d: disable for old chipset steppings with incompatible page table format.
Signed-off-by: Allen Kay <allen.m.kay@xxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vtd/dmar.c  |   16 +++++++++++-----
 xen/arch/x86/hvm/vmx/vtd/dmar.h  |    2 ++
 xen/arch/x86/hvm/vmx/vtd/utils.c |   31 +++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+), 5 deletions(-)

diff -r 40d88481cd3f -r 4fdcea9881b2 xen/arch/x86/hvm/vmx/vtd/dmar.c
--- a/xen/arch/x86/hvm/vmx/vtd/dmar.c   Sun Sep 23 12:45:07 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vtd/dmar.c   Sun Sep 23 12:55:50 2007 +0100
@@ -489,6 +489,13 @@ int acpi_dmar_init(void)
 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;
-
-    return 0;
-}
+    ioapic_ack_new = 0;
+
+    return 0;
+}
diff -r 40d88481cd3f -r 4fdcea9881b2 xen/arch/x86/hvm/vmx/vtd/dmar.h
--- a/xen/arch/x86/hvm/vmx/vtd/dmar.h   Sun Sep 23 12:45:07 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vtd/dmar.h   Sun Sep 23 12:55:50 2007 +0100
@@ -87,4 +87,6 @@ struct acpi_ioapic_unit {
     }ioapic;
 };
 
+int vtd_hw_check(void);
+
 #endif // _DMAR_H_
diff -r 40d88481cd3f -r 4fdcea9881b2 xen/arch/x86/hvm/vmx/vtd/utils.c
--- a/xen/arch/x86/hvm/vmx/vtd/utils.c  Sun Sep 23 12:45:07 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vtd/utils.c  Sun Sep 23 12:55:50 2007 +0100
@@ -32,6 +32,37 @@
 
 #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)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.