debuggers.hg

changeset 20936:0c3e4a2f14d6

VT-d: fix a bug in enable_ats_device

In enable_ats_device, it should enable ATS if find matched atsr unit
for a device, and don't enable it if no matched atsr unit. But current
code does contrarily. This patch fixes it.

Signed-off-by: Weidong Han <Weidong.han@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 03 09:46:38 2010 +0000 (2010-02-03)
parents 7a10f8513b3f
children 91358472d8c4
files xen/drivers/passthrough/vtd/x86/ats.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/x86/ats.c	Wed Feb 03 09:46:01 2010 +0000
     1.2 +++ b/xen/drivers/passthrough/vtd/x86/ats.c	Wed Feb 03 09:46:38 2010 +0000
     1.3 @@ -118,8 +118,13 @@ int enable_ats_device(int seg, int bus, 
     1.4      u16 queue_depth;
     1.5      int pos;
     1.6  
     1.7 -    if ( acpi_find_matched_atsr_unit(bus, devfn) )
     1.8 +    if ( !acpi_find_matched_atsr_unit(bus, devfn) )
     1.9 +    {
    1.10 +        dprintk(XENLOG_WARNING VTDPREFIX,
    1.11 +                "cannot find matched atsr for %x:%x.%x\n",
    1.12 +                bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
    1.13          return 0;
    1.14 +    }
    1.15  
    1.16      pos = pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
    1.17      if ( !pos )