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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 Aug 2022 09:37:07 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Baolu Lu <baolu.lu@...ux.intel.com>
Cc:     Joerg Roedel <joro@...tes.org>,
        Christoph Hellwig <hch@...radead.org>,
        Kevin Tian <kevin.tian@...el.com>,
        Ashok Raj <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jean-Philippe Brucker <jean-philippe@...aro.com>,
        Dave Jiang <dave.jiang@...el.com>,
        Vinod Koul <vkoul@...nel.org>,
        Eric Auger <eric.auger@...hat.com>,
        Liu Yi L <yi.l.liu@...el.com>,
        Jacob jun Pan <jacob.jun.pan@...el.com>,
        Zhangfei Gao <zhangfei.gao@...aro.org>,
        Zhu Tony <tony.zhu@...el.com>, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org,
        Jean-Philippe Brucker <jean-philippe@...aro.org>
Subject: Re: [PATCH v10 04/12] iommu: Add attach/detach_dev_pasid iommu
 interface

On Tue, Aug 02, 2022 at 10:19:08AM +0800, Baolu Lu wrote:
> Hi Jason,
> 
> On 7/26/22 9:57 PM, Jason Gunthorpe wrote:
> > > +	/*
> > > +	 * Block PASID attachment in all cases where the PCI fabric is
> > > +	 * routing based on address. ACS disables it.
> > > +	 */
> > > +	if (dev_is_pci(dev) &&
> > > +	    !pci_acs_path_enabled(to_pci_dev(dev), NULL, REQ_ACS_FLAGS))
> > > +		return -ENODEV;
> > I would probably still put this in a function just to be clear, and
> > probably even a PCI layer funcion 'pci_is_pasid_supported' that
> > clearly indicates that the fabric path can route a PASID packet
> > without mis-routing it.
> 
> I am fine with putting above in a function to make it clear. But I am
> hesitant to move this part of logic into the PCI layer.
> 
> From the perspective of IOMMU, TLPs with PASID prefix form distinct
> address spaces, so it's reasonable to require ACS protection on the
> upstream path.
> 
> But PCI spec doesn't require this. The interfaces defined in drivers/pci
> /ats.c should work as well even the IOMMU is disabled.

No, I don't think so, that is useless.

PCI SIG has given a bunch of tools, and it is up to the system
software to figure out how to use them.

There is no reasonable case where Linux would want PASID and broken
fabric routing - so just block it at the PCI layer.

> Yes, agreed. The iommu groups are not an issue any more. But just like
> iommu_attach_device(), if multiple devices share a group, there must be
> some mechanism to make sure that device drivers are aware of this fact
> and only attach a shared domain to any PASID of those devices.'
> Otherwise, the iommu_attach/detach_dev_pasid() might be misused.

I think it is the same as the existing attach logic for groups, with
the sharing, owern and everything else did. No change for pasid.
 
> Considering that all existing PASID use cases are singleton group case,
> probably we can start our support from the simple singleton group case?

Don't make confusing unnecessary special cases please.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ