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: <20250917184625.GA10800@unreal>
Date: Wed, 17 Sep 2025 21:46:25 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Marek Szyprowski <m.szyprowski@...sung.com>, iommu@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Russell King <linux@...linux.org.uk>
Subject: Re: [PATCH v3 3/4] ARM: dma-mapping: Switch to physical address
 mapping callbacks

On Wed, Sep 17, 2025 at 10:58:19AM -0300, Jason Gunthorpe wrote:
> On Wed, Sep 17, 2025 at 04:41:28PM +0300, Leon Romanovsky wrote:
> > On Wed, Sep 17, 2025 at 08:32:48AM -0300, Jason Gunthorpe wrote:
> > > On Wed, Sep 17, 2025 at 01:36:44PM +0300, Leon Romanovsky wrote:
> > > > On Tue, Sep 16, 2025 at 03:46:17PM -0300, Jason Gunthorpe wrote:
> > > > > On Tue, Sep 16, 2025 at 10:32:06AM +0300, Leon Romanovsky wrote:
> > > > > > +	if (!dev->dma_coherent &&
> > > > > > +	    !(attrs & (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_MMIO)))
> > > > > > +		__dma_page_cpu_to_dev(phys_to_page(phys), offset, size, dir);
> > > > > 
> > > > > I'd keep going and get rid of the page here too, maybe as a second
> > > > > patch in this series:
> > > > 
> > > > Thanks, it is always unclear how far to go with cleanups.
> > > 
> > > IMHO to maximally support what Matthew is working on I'd remove all
> > > the struct page things and prefer the pfn/phys variations from the MM
> > > side.
> > 
> > ok, my patches can be found here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=dmabuf-vfio
> > 
> > I converted "struct page" path from all archs with .map_page.
> 
> Yeah, that's right, I would split this into a few series
> 
> This group is all fairly trivial stuff that didn't use the struct
> page or virt address at all:
> 
>  MIPS/jazzdma
>  x86
>  vdpa
>  xen: swiotlb:  (though make a phys_to_xen_pfn() macro)
> 
> I'd also drop the ATTR_MMIO checks from x86 and jazzdma
> since the code is obviously fine with any phys.

It is not trivial as it sounds.

Let's take as an example MIPS/jazzdma, should we call to vdma_alloc()
in DMA_ATTR_MMIO case? or directly return "phys" as it is done in other
architectures?

> 
> vdpa can support ATTR_MMIO with the same iommu prot MMIO adjustment,
> that would be a good additional patch.

There is "bounce page" in VDPA, it sounds like swiotlb to me, which
doesn't work with MMIO.

> 
> Then there are more conversions that don't use struct page or va but
> are not so trivial
> 
> alpha
> parisc
> 
> Then the last ones sparc/power are quite complicated and do use
> __va/etc.
> 
> Jason
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ