lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fcef9cb1-797a-496a-9ef5-1e2f530dc8f6@linux.intel.com>
Date: Thu, 7 Nov 2024 09:51:11 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Jason Gunthorpe <jgg@...dia.com>, Zhangfei Gao <zhangfei.gao@...aro.org>
Cc: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
 jean-philippe <jean-philippe@...aro.org>, shamiali2008@...il.com,
 iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommufd: modify iommufd_fault_iopf_enable limitation

On 11/6/24 21:59, Jason Gunthorpe wrote:
> 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@...aro.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@...aro.org>
>>> Signed-off-by: Lu Baolu<baolu.lu@...ux.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?

This change looks good to me. But the s-o-b chain would make more sense
if we can make it like this,

Co-developed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
Signed-off-by: Zhangfei Gao<zhangfei.gao@...aro.org>

With this addressed,

Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>

--
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ