[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Oct 2017 15:21:20 +0200
From: Joerg Roedel <joro@...tes.org>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc: iommu@...ts.linux-foundation.org,
LKML <linux-kernel@...r.kernel.org>,
David Woodhouse <dwmw2@...radead.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rafael Wysocki <rafael.j.wysocki@...el.com>,
Jean-Philippe Brucker <jean-philippe.brucker@....com>,
"Liu, Yi L" <yi.l.liu@...el.com>,
Lan Tianyu <tianyu.lan@...el.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
Raj Ashok <ashok.raj@...el.com>,
Alex Williamson <alex.williamson@...hat.com>, Liu@...tes.org,
Yi L <yi.l.liu@...ux.intel.com>
Subject: Re: [PATCH v2 02/16] iommu/vt-d: add bind_pasid_table function
On Thu, Oct 05, 2017 at 04:03:30PM -0700, Jacob Pan wrote:
> + pdev = to_pci_dev(dev);
> + if (!pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI))
> + return -EINVAL;
> + sid = PCI_DEVID(bus, devfn);
Okay, you search for the PRI capability ...
> +
> + info = dev->archdata.iommu;
> + if (!info || !info->pasid_supported) {
> + dev_err(dev, "No PASID support\n");
> + ret = -EINVAL;
> + goto out;
> + }
> + if (!info->pasid_enabled) {
> + ret = pci_enable_pasid(pdev, info->pasid_supported & ~1);
> + if (ret)
> + goto out;
... and you enable PASID in bind_pasid_table() ...
> + /*
> + * REVISIT: we might want to clear the PASID table pointer
> + * as part of context clear operation. Currently, it leaves
> + * stale data but should be ignored by hardware since PASIDE
> + * is clear.
> + */
> + /* ATS will be reenabled when remapping is restored */
> + pci_disable_ats(to_pci_dev(dev));
.. while you disable ATS in unbind_pasid_table(). Where does this
asymmetry come from?
> #define CONTEXT_DINVE (1ULL << 8)
> #define CONTEXT_PRS (1ULL << 9)
> +#define CONTEXT_NESTE (1ULL << 10)
Missing 'D' at the end?
Powered by blists - more mailing lists