From: Jason Gunthorpe <jgg@nvidia.com>
To: Zhangfei Gao <zhangfei.gao@linaro.org>, baolu.lu@linux.intel.com
Cc: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
jean-philippe <jean-philippe@linaro.org>,
shamiali2008@gmail.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommufd: modify iommufd_fault_iopf_enable limitation
Date: Wed, 6 Nov 2024 09:59:44 -0400 [thread overview]
Message-ID: <20241106135944.GP458827@nvidia.com> (raw)
In-Reply-To: <CABQgh9H9HWaKRP=rFvXf90PjfVP1M6YpwfLcYTZH1hWET6GPsw@mail.gmail.com>
On Wed, Nov 06, 2024 at 05:47:09AM +0000, Zhangfei Gao wrote:
> On Mon, 28 Oct 2024 at 11:32, Zhangfei Gao <zhangfei.gao@linaro.org> wrote:
> >
> > iommufd_fault_iopf_enable has limitation to PRI on PCI/SRIOV VFs
> > because the PRI might be a shared resource and current iommu
> > subsystem is not ready to support enabling/disabling PRI on a VF
> > without any impact on others.
> >
> > However, we have devices that appear as PCI but are actually on the
> > AMBA bus. These fake PCI devices have PASID capability, support
> > stall as well as SRIOV, so remove the limitation for these devices.
> >
> > Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> > Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
> > ---
> > drivers/iommu/iommufd/fault.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iommu/iommufd/fault.c b/drivers/iommu/iommufd/fault.c
> > index bca956d496bd..8b3e34250dae 100644
> > --- a/drivers/iommu/iommufd/fault.c
> > +++ b/drivers/iommu/iommufd/fault.c
> > @@ -10,6 +10,7 @@
> > #include <linux/module.h>
> > #include <linux/mutex.h>
> > #include <linux/pci.h>
> > +#include <linux/pci-ats.h>
> > #include <linux/poll.h>
> > #include <uapi/linux/iommufd.h>
> >
> > @@ -27,8 +28,12 @@ static int iommufd_fault_iopf_enable(struct iommufd_device *idev)
> > * resource between PF and VFs. There is no coordination for this
> > * shared capability. This waits for a vPRI reset to recover.
> > */
> > - if (dev_is_pci(dev) && to_pci_dev(dev)->is_virtfn)
> > - return -EINVAL;
> > + if (dev_is_pci(dev)) {
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > +
> > + if (pdev->is_virtfn && pci_pri_supported(pdev))
> > + return -EINVAL;
> > + }
> >
> > mutex_lock(&idev->iopf_lock);
> > /* Device iopf has already been on. */
> >
>
> Hi, Jason
>
> Would you mind also taking a look at this.
Lu? Are you OK with this?
Jason
next prev parent reply other threads:[~2024-11-06 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 11:32 [PATCH] iommufd: modify iommufd_fault_iopf_enable limitation Zhangfei Gao
2024-11-06 5:47 ` Zhangfei Gao
2024-11-06 13:59 ` Jason Gunthorpe [this message]
2024-11-07 1:51 ` Baolu Lu
2024-11-07 4:40 ` Zhangfei Gao
2024-11-07 4:37 ` [PATCH v2] " Zhangfei Gao
2024-11-07 17:12 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106135944.GP458827@nvidia.com \
--to=jgg@nvidia.com \
--cc=baolu.lu@linux.intel.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shamiali2008@gmail.com \
--cc=will@kernel.org \
--cc=zhangfei.gao@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.