ia64/xen-unstable

changeset 15963:4fdcea9881b2

vt-d: disable for old chipset steppings with incompatible page table format.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir@xensource.com>
date Sun Sep 23 12:55:50 2007 +0100 (2007-09-23)
parents 40d88481cd3f
children d17532dc1725
files xen/arch/x86/hvm/vmx/vtd/dmar.c xen/arch/x86/hvm/vmx/vtd/dmar.h xen/arch/x86/hvm/vmx/vtd/utils.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vtd/dmar.c	Sun Sep 23 12:45:07 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vtd/dmar.c	Sun Sep 23 12:55:50 2007 +0100
     1.3 @@ -489,6 +489,13 @@ acpi_parse_dmar(unsigned long phys_addr,
     1.4  int acpi_dmar_init(void)
     1.5  {
     1.6      extern int ioapic_ack_new;
     1.7 +    int rc;
     1.8 +
     1.9 +    if (!vtd_enabled)
    1.10 +        return -ENODEV;
    1.11 +
    1.12 +    if ((rc = vtd_hw_check()) != 0)
    1.13 +        return rc;
    1.14  
    1.15      acpi_table_parse(ACPI_DMAR, acpi_parse_dmar);
    1.16  
    1.17 @@ -499,8 +506,7 @@ int acpi_dmar_init(void)
    1.18      }
    1.19  
    1.20      /* Use fake-vector style of IOAPIC acknowledgement. */
    1.21 -    if (vtd_enabled)
    1.22 -        ioapic_ack_new = 0;
    1.23 +    ioapic_ack_new = 0;
    1.24  
    1.25      return 0;
    1.26  }
     2.1 --- a/xen/arch/x86/hvm/vmx/vtd/dmar.h	Sun Sep 23 12:45:07 2007 +0100
     2.2 +++ b/xen/arch/x86/hvm/vmx/vtd/dmar.h	Sun Sep 23 12:55:50 2007 +0100
     2.3 @@ -87,4 +87,6 @@ struct acpi_ioapic_unit {
     2.4      }ioapic;
     2.5  };
     2.6  
     2.7 +int vtd_hw_check(void);
     2.8 +
     2.9  #endif // _DMAR_H_
     3.1 --- a/xen/arch/x86/hvm/vmx/vtd/utils.c	Sun Sep 23 12:45:07 2007 +0100
     3.2 +++ b/xen/arch/x86/hvm/vmx/vtd/utils.c	Sun Sep 23 12:55:50 2007 +0100
     3.3 @@ -33,6 +33,37 @@
     3.4  #include <xen/mm.h>
     3.5  #include <xen/xmalloc.h>
     3.6  
     3.7 +#define VTDPREFIX "[VT-D]" 
     3.8 +#define INTEL   0x8086
     3.9 +#define SEABURG 0x4000
    3.10 +#define C_STEP  2
    3.11 +
    3.12 +int vtd_hw_check(void)
    3.13 +{
    3.14 +    u16 vendor, device;
    3.15 +    u8 revision, stepping;
    3.16 +
    3.17 +    vendor   = read_pci_config_16(0, 0, 0, PCI_VENDOR_ID);
    3.18 +    device   = read_pci_config_16(0, 0, 0, PCI_DEVICE_ID);
    3.19 +    revision = read_pci_config_byte(0, 0, 0, PCI_REVISION_ID);
    3.20 +    stepping = revision & 0xf;
    3.21 +
    3.22 +    if ( (vendor == INTEL) && (device == SEABURG) )
    3.23 +    {
    3.24 +        if ( stepping < C_STEP )
    3.25 +        {
    3.26 +            dprintk(XENLOG_WARNING VTDPREFIX,
    3.27 +                    "*** VT-d disabled - pre C0-step Seaburg found\n");
    3.28 +            dprintk(XENLOG_WARNING VTDPREFIX,
    3.29 +                    "***  vendor = %x device = %x revision = %x\n",
    3.30 +                    vendor, device, revision);
    3.31 +            vtd_enabled = 0;
    3.32 +            return -ENODEV;
    3.33 +        }
    3.34 +    }
    3.35 +    return 0;
    3.36 +}
    3.37 +
    3.38  #if defined(__x86_64__)
    3.39  void print_iommu_regs(struct acpi_drhd_unit *drhd)
    3.40  {