WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] vt-d: disable for old chipset steppings w

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vt-d: disable for old chipset steppings with incompatible page table format.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Sep 2007 03:41:14 -0700
Delivery-date: Wed, 26 Sep 2007 04:28:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vt-d: disable for old chipset steppings with incompatible page table format., Xen patchbot-unstable <=