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: <3db6f346-0cb4-41f7-b532-91bcb0265849@linux.intel.com>
Date: Tue, 10 Dec 2024 10:57:49 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Matthew Rosato <mjrosato@...ux.ibm.com>, joro@...tes.org,
 will@...nel.org, robin.murphy@....com, gerald.schaefer@...ux.ibm.com,
 schnelle@...ux.ibm.com
Cc: hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
 svens@...ux.ibm.com, borntraeger@...ux.ibm.com, farman@...ux.ibm.com,
 clegoate@...hat.com, iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
 linux-s390@...r.kernel.org
Subject: Re: [PATCH 5/6] iommu: document missing def_domain_type return

On 12/10/24 03:24, Matthew Rosato wrote:
> In addition to IOMMU_DOMAIN_DMA, def_domain_type can also return
> IOMMU_DOMAIN_DMA_FQ when applicable, else flush queues will never be
> used.
> 
> Signed-off-by: Matthew Rosato<mjrosato@...ux.ibm.com>
> ---
>   include/linux/iommu.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 05279109c732..d0da1918d2de 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -585,6 +585,7 @@ iommu_copy_struct_from_full_user_array(void *kdst, size_t kdst_entry_size,
>    * @def_domain_type: device default domain type, return value:
>    *		- IOMMU_DOMAIN_IDENTITY: must use an identity domain
>    *		- IOMMU_DOMAIN_DMA: must use a dma domain
> + *              - IOMMU_DOMAIN_DMA_FQ: dma domain with batch invalidation

In which case must an iommu driver return IOMMU_DOMAIN_DMA_FQ?

The flush queue is a policy of "when and how to synchronize the IOTLB"
in dma-iommu.c. The iommu driver actually has no need to understand such
policy.

By the way, "dma domain" in this comment is a bit confusing, it reads
better if we make it like:

- IOMMU_DOMAIN_IDENTITY: must use an identity domain
- IOMMU_DOMAIN_DMA: must use a paging domain

Thanks,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ