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: <01a591dc-4918-3c8d-e3f4-b4b738919ee5@linux.intel.com>
Date:   Sat, 30 Jul 2022 14:17:40 +0800
From:   Baolu Lu <baolu.lu@...ux.intel.com>
To:     "Tian, Kevin" <kevin.tian@...el.com>,
        Jason Gunthorpe <jgg@...dia.com>
Cc:     baolu.lu@...ux.intel.com, Joerg Roedel <joro@...tes.org>,
        Christoph Hellwig <hch@...radead.org>,
        "Raj, Ashok" <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jean-Philippe Brucker <jean-philippe@...aro.com>,
        "Jiang, Dave" <dave.jiang@...el.com>,
        Vinod Koul <vkoul@...nel.org>,
        Eric Auger <eric.auger@...hat.com>,
        "Liu, Yi L" <yi.l.liu@...el.com>,
        "Pan, Jacob jun" <jacob.jun.pan@...el.com>,
        Zhangfei Gao <zhangfei.gao@...aro.org>,
        "Zhu, Tony" <tony.zhu@...el.com>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <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 2022/7/29 12:22, Tian, Kevin wrote:
>> From: Baolu Lu <baolu.lu@...ux.intel.com>
>> Sent: Friday, July 29, 2022 11:21 AM
>>
>> On 2022/7/29 10:56, Tian, Kevin wrote:
>>>> +static bool iommu_group_device_pasid_viable(struct iommu_group
>> *group,
>>>> +					    struct device *dev)
>>>> +{
>>>> +	int count;
>>>> +
>>>> +	count = iommu_group_device_count(group);
>>>> +	if (count != 1)
>>>> +		return false;
>>>> +
>>>> +	/*
>>>> +	 * Block PASID attachment in cases where the PCI fabric is
>>>> +	 * routing based on address. PCI/ACS disables that.
>>>> +	 */
>>>> +	if (dev_is_pci(dev))
>>>> +		return pci_acs_path_enabled(to_pci_dev(dev), NULL,
>>>> +					    REQ_ACS_FLAGS);
>>> I think we are leaning toward doing above check in pci_enable_pasid().
>>> Then no singleton check inside iommu core.
>>
>> The iommu grouping also considers other things, like PCI alias. There
>> are many calls of pci_add_dma_alias() in drivers/pci/quirks.c.
>> Therefore, I believe that pci_acs_path_enabled() returning true doesn't
>> guarantees a singleton group.
> 
> Is there an actual problem of sharing PASID table between aliasing RIDs?
> As long as ACS is enabled the device is isolated from other devices
> in the fabric. DMA aliases don't change that fact and there is no p2p
> between aliasing RIDs.

Yes. Agreed.

At present, the visible PASID use cases only occur on the singleton
groups, so we can start to support it from this simple situation. In the
future, if the multi-device groups need to support pasid, we can simply
apply the domain to the PASIDs of all device of the group.

> 
>>
>>>
>>> Presumably similar check can be done in DT/ACPI path of enabling pasid?
>>>
>>
>> I can't find the pasid (or anything similar) enabling interfaces for
>> DT or ACPI. They are device specific?
>>
> 
> Looks only PCI PASID is supported so far. both in Intel/ARM/AMD
> drivers. If other buses will support PASID one day, then ACS-equivalent
> can be also checked in their PASID enabling APIs.

Yes. Fair enough.

Best regards,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ