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] [day] [month] [year] [list]
Message-ID: <9c3ba9fa-c433-4d6e-9570-dd11daf5a06d@arm.com>
Date: Fri, 28 Feb 2025 11:20:55 +0000
From: Robin Murphy <robin.murphy@....com>
To: Nicolin Chen <nicolinc@...dia.com>, Jason Gunthorpe <jgg@...dia.com>
Cc: joro@...tes.org, will@...nel.org, alex.williamson@...hat.com,
 iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v1 2/4] iommu: Add iommu_default_domain_free helper

On 27/02/2025 11:32 pm, Nicolin Chen wrote:
> On Thu, Feb 27, 2025 at 05:03:36PM -0400, Jason Gunthorpe wrote:
>> On Thu, Feb 27, 2025 at 12:59:04PM -0800, Nicolin Chen wrote:
>>> On Thu, Feb 27, 2025 at 03:50:36PM -0400, Jason Gunthorpe wrote:
>>>> On Wed, Feb 26, 2025 at 12:16:05PM -0800, Nicolin Chen wrote:
>>>>> The iommu_put_dma_cookie() will be moved out of iommu_domain_free(). For a
>>>>> default domain, iommu_put_dma_cookie() can be simply added to this helper.
>>>>>
>>>>> Suggested-by: Jason Gunthorpe <jgg@...dia.com>
>>>>> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
>>>>> ---
>>>>>   drivers/iommu/iommu.c | 11 ++++++++---
>>>>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>>>
>>>> Let's try to do what Robin suggested and put a private_data_owner
>>>> value in the struct then this patch isn't used, we'd just do
>>>>
>>>>        if (domain->private_data_owner == DMA)
>>>> 	iommu_put_dma_cookie(domain);
>>>>
>>>> Instead of this change and the similar VFIO change
>>>
>>> Ack. I assume I should go with a smaller series starting with this
>>> "private_data_owner", and then later a bigger series for the other
>>> bits like translation_type that you mentioned in the other thread.
>>
>> That could work, you could bitfiled type and steal a few bits for
>> "private_data_owner" ?
>>
>> Then try the sw_msi removal at the same time too?
> 
> Ack. I drafted four patches:
>    iommu: Add private_data_owner to iommu_domain_free
>    iommu: Turn iova_cookie to dma-iommu private pointer
>    iommufd: Move iommufd_sw_msi and related functions to driver.c
>    iommu: Drop sw_msi from iommu_domain
> 
> Will do some proper build tests and then wrap them up.

Ah, I spent yesterday also writing up a patch to sort things out more 
generally - expect to see that shortly, then we can decide what we like.

Cheers,
Robin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ