[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-4.2-testing] IOMMU/ATS: fix maximum queue depth calculation
# HG changeset patch # User Jan Beulich <jbeulich@xxxxxxxx> # Date 1355917993 -3600 # Node ID b533c473029ff99f0f130da758134acaec4f97d4 # Parent df2a3515788de458742ed205b073fc5a2c7a9cef IOMMU/ATS: fix maximum queue depth calculation The capabilities register field is a 5-bit value, and the 5 bits all being zero actually means 32 entries. Under the assumption that amd_iommu_flush_iotlb() really just tried to correct for the miscalculation above when adding 32 to the value, that adjustment is also being removed. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by Xiantao Zhang <xiantao.zhang@xxxxxxxxx> Acked-by: Wei Huang <wei.huang2@xxxxxxx> xen-unstable changeset: 26235:670b07e8d738 xen-unstable date: Wed Dec 5 08:52:14 UTC 2012 --- diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/amd/iommu_cmd.c --- a/xen/drivers/passthrough/amd/iommu_cmd.c Wed Dec 19 12:51:46 2012 +0100 +++ b/xen/drivers/passthrough/amd/iommu_cmd.c Wed Dec 19 12:53:13 2012 +0100 @@ -321,7 +321,7 @@ void amd_iommu_flush_iotlb(struct pci_de req_id = get_dma_requestor_id(iommu->seg, bdf); queueid = req_id; - maxpend = (ats_pdev->ats_queue_depth + 32) & 0xff; + maxpend = ats_pdev->ats_queue_depth & 0xff; /* send INVALIDATE_IOTLB_PAGES command */ spin_lock_irqsave(&iommu->lock, flags); diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/ats.h --- a/xen/drivers/passthrough/ats.h Wed Dec 19 12:51:46 2012 +0100 +++ b/xen/drivers/passthrough/ats.h Wed Dec 19 12:53:13 2012 +0100 @@ -30,7 +30,7 @@ struct pci_ats_dev { #define ATS_REG_CAP 4 #define ATS_REG_CTL 6 -#define ATS_QUEUE_DEPTH_MASK 0xF +#define ATS_QUEUE_DEPTH_MASK 0x1f #define ATS_ENABLE (1<<15) extern struct list_head ats_devices; diff -r df2a3515788d -r b533c473029f xen/drivers/passthrough/x86/ats.c --- a/xen/drivers/passthrough/x86/ats.c Wed Dec 19 12:51:46 2012 +0100 +++ b/xen/drivers/passthrough/x86/ats.c Wed Dec 19 12:53:13 2012 +0100 @@ -93,7 +93,8 @@ int enable_ats_device(int seg, int bus, pdev->devfn = devfn; value = pci_conf_read16(seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), pos + ATS_REG_CAP); - pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK; + pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?: + ATS_QUEUE_DEPTH_MASK + 1; list_add(&pdev->list, &ats_devices); } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |