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]
Message-ID: <6d5303a7-18d2-2481-18d1-c3d8fcf0d864@linux.intel.com>
Date:   Mon, 21 Aug 2023 13:46:44 +0800
From:   Baolu Lu <baolu.lu@...ux.intel.com>
To:     Nicolin Chen <nicolinc@...dia.com>
Cc:     baolu.lu@...ux.intel.com, Joerg Roedel <joro@...tes.org>,
        Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Kevin Tian <kevin.tian@...el.com>,
        Jean-Philippe Brucker <jean-philippe@...aro.org>,
        Yi Liu <yi.l.liu@...el.com>,
        Jacob Pan <jacob.jun.pan@...ux.intel.com>,
        iommu@...ts.linux.dev, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] iommu: Consolidate pasid dma ownership check

On 2023/8/18 13:43, Nicolin Chen wrote:
> On Mon, Aug 14, 2023 at 09:17:58AM +0800, Lu Baolu wrote:
> 
>> When switching device DMA ownership, it is required that all the device's
>> pasid DMA be disabled. This is done by checking if the pasid array of the
>> group is empty. Consolidate all the open code into a single helper. No
>> intentional functionality change.
>>
>> Signed-off-by: Lu Baolu<baolu.lu@...ux.intel.com>
>> ---
>>   drivers/iommu/iommu.c | 23 ++++++++++++++++++-----
>>   1 file changed, 18 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
>> index f1eba60e573f..d4a06a37ce39 100644
>> --- a/drivers/iommu/iommu.c
>> +++ b/drivers/iommu/iommu.c
>> @@ -3127,6 +3127,19 @@ static bool iommu_is_default_domain(struct iommu_group *group)
>>          return false;
>>   }
>>
>> +/*
>> + * Assert no PASID DMA when claiming or releasing group's DMA ownership.
>               ^
> 	     |...
> 
>> + * The device pasid interfaces are only for device drivers that have
>> + * claimed the DMA ownership. Return true if no pasid DMA setup, otherwise
>> + * return false with a WARN().
>> + */
>> +static bool assert_pasid_dma_ownership(struct iommu_group *group)
> ... should it be assert_no_pasid_dma_ownership?

Fair enough. Or, perhaps just assert_no_pasid_dma()?

Best regards,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ