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] [day] [month] [year] [list]
Message-ID: <df9da8af-3a10-4f8b-8e4a-63e4ba473e17@actia.se>
Date: Fri, 9 May 2025 07:48:03 +0000
From: John Ernberg <john.ernberg@...ia.se>
To: Stefano Stabellini <sstabellini@...nel.org>, Christoph Hellwig
	<hch@...radead.org>
CC: 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

Hi Stefano,

On 5/9/25 1:14 AM, Stefano Stabellini wrote:
> 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.

Thank you for explaining. I will spin a V2 incorporating this.
Thanks! // John Ernberg

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ