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: <alpine.DEB.2.22.394.2505081614450.3879245@ubuntu-linux-20-04-desktop>
Date: Thu, 8 May 2025 16:14:49 -0700 (PDT)
From: Stefano Stabellini <sstabellini@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
cc: Stefano Stabellini <sstabellini@...nel.org>, 
    John Ernberg <john.ernberg@...ia.se>, Juergen Gross <jgross@...e.com>, 
    Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>, 
    Catalin Marinas <catalin.marinas@....com>, 
    Andrew Morton <akpm@...ux-foundation.org>, 
    "xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>, 
    "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>, 
    "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, 
    "imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: Re: [PATCH 2/2] xen: swiotlb: Implement map_resource callback

On Wed, 7 May 2025, Christoph Hellwig wrote:
> On Wed, May 07, 2025 at 04:09:15PM -0700, Stefano Stabellini wrote:
> > > This mapping is not for a RAM backed address. In the eDMA case for the 
> > > iMX8QXP the `phys` coming in here is the address of a register.
> > 
> > Ok, this information is important :-)
> > 
> > I am not certain whether the map_resource interface can only be called
> > for MMIO addresses or if it can also be called for RAM-backed addresses
> > with a size > PAGE_SIZE. In the latter case, we could run into the issue
> > I was describing.
> 
> map_resource is intended for MMIO regions, although those could be >
> PAGE_SIZE.  It must not be called on RAM.

In that case, John, you can just use dma_direct_map_resource().

That's because MMIO regions:
- are 1:1 mapped on ARM
- are 1:1 mapped on x86 for PV Dom0
- might not be 1:1 mapped on x86 for PVH Dom0, but in this case we rely
  on the IOMMU to do address translation

In none of these cases xen_phys_to_dma would give us any interesting
results.  It would be the same as calling phys_to_dma.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ