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: <d83afae060351f49fe0ba661f69c1d0b00538a35.camel@linux.ibm.com>
Date: Mon, 17 Mar 2025 10:52:11 +0100
From: Niklas Schnelle <schnelle@...ux.ibm.com>
To: Leon Romanovsky <leon@...nel.org>, Christoph Hellwig <hch@....de>,
        Jason
 Gunthorpe <jgg@...pe.ca>, Robin Murphy <robin.murphy@....com>
Cc: Jens Axboe <axboe@...nel.dk>, Joerg Roedel <joro@...tes.org>,
        Will
 Deacon	 <will@...nel.org>, Sagi Grimberg <sagi@...mberg.me>,
        Keith Busch	
 <kbusch@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
        Logan Gunthorpe	
 <logang@...tatee.com>,
        Yishai Hadas <yishaih@...dia.com>,
        Shameer Kolothum	
 <shameerali.kolothum.thodi@...wei.com>,
        Kevin Tian <kevin.tian@...el.com>,
        Alex Williamson <alex.williamson@...hat.com>,
        Marek Szyprowski
 <m.szyprowski@...sung.com>,
        Jérôme Glisse	
 <jglisse@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jonathan
 Corbet <corbet@....net>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-rdma@...r.kernel.org, iommu@...ts.linux.dev,
        linux-nvme@...ts.infradead.org, linux-pci@...r.kernel.org,
        kvm@...r.kernel.org, linux-mm@...ck.org,
        Randy Dunlap
 <rdunlap@...radead.org>
Subject: Re: [PATCH v7 03/17] iommu: generalize the batched sync after map
 interface

On Wed, 2025-02-05 at 16:40 +0200, Leon Romanovsky wrote:
> From: Christoph Hellwig <hch@....de>
> 
> For the upcoming IOVA-based DMA API we want to use the interface batch the
> sync after mapping multiple entries from dma-iommu without having a
> scatterlist.
> 
> For that move more sanity checks from the callers into __iommu_map and
> make that function available outside of iommu.c as iommu_map_nosync.
> 
> Add a wrapper for the map_sync as iommu_sync_map so that callers don't
> need to poke into the methods directly.
> 
> Signed-off-by: Christoph Hellwig <hch@....de>
> Acked-by: Will Deacon <will@...nel.org>
> Signed-off-by: Leon Romanovsky <leonro@...dia.com>
> ---
>  drivers/iommu/iommu.c | 65 +++++++++++++++++++------------------------
>  include/linux/iommu.h |  4 +++
>  2 files changed, 33 insertions(+), 36 deletions(-)
> 
> 
--- snip ---
> +
>  	return mapped;
>  
>  out_err:
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index 38c65e92ecd0..7ae9aa3a1894 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -857,6 +857,10 @@ extern struct iommu_domain *iommu_get_domain_for_dev(struct device *dev);
>  extern struct iommu_domain *iommu_get_dma_domain(struct device *dev);
>  extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
>  		     phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
> +int iommu_map_nosync(struct iommu_domain *domain, unsigned long iova,
> +		phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
> +int iommu_sync_map(struct iommu_domain *domain, unsigned long iova,
> +		size_t size);

There are two different word orders in the function names.
iommu_sync_map() vs iommu_map_nosync(). I'd prefer to be consistent
with e.g. iommu_map_sync() vs iommu_map_nosync().

>  extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
>  			  size_t size);
>  extern size_t iommu_unmap_fast(struct iommu_domain *domain,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ