mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Ernberg <john.ernberg@actia.se>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Cc: Juergen Gross <jgross@suse.com>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>
Subject: Re: [PATCH 2/2] xen: swiotlb: Implement map_resource callback
Date: Fri, 9 May 2025 07:48:03 +0000	[thread overview]
Message-ID: <df9da8af-3a10-4f8b-8e4a-63e4ba473e17@actia.se> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2505081614450.3879245@ubuntu-linux-20-04-desktop>

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

      reply	other threads:[~2025-05-09  7:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 11:40 [PATCH 0/2] xen: swiotlb: 2 fixes SoCs w/o IOMMU (e.g. iMX8QXP) John Ernberg
2025-05-02 11:40 ` [PATCH 1/2] xen: swiotlb: Use swiotlb bouncing if kmalloc allocation demands it John Ernberg
2025-05-02 17:07   ` Stefano Stabellini
2025-05-08 15:21   ` Catalin Marinas
2025-05-02 11:40 ` [PATCH 2/2] xen: swiotlb: Implement map_resource callback John Ernberg
2025-05-02 17:20   ` Stefano Stabellini
2025-05-06 12:22     ` John Ernberg
2025-05-07 23:09       ` Stefano Stabellini
2025-05-08  4:14         ` Christoph Hellwig
2025-05-08 23:14           ` Stefano Stabellini
2025-05-09  7:48             ` John Ernberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df9da8af-3a10-4f8b-8e4a-63e4ba473e17@actia.se \
    --to=john.ernberg@actia.se \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=hch@infradead.org \
    --cc=imx@lists.linux.dev \
    --cc=iommu@lists.linux.dev \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®