All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	lkml <linux-kernel@vger.kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 12/12] swiotlb-xen: this is PV-only on x86
Date: Mon, 13 Sep 2021 09:28:39 +0200	[thread overview]
Message-ID: <543b446b-0143-ad32-99ed-d7a6f79381e8@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2109101636470.10523@sstabellini-ThinkPad-T480s>

On 11.09.2021 01:48, Stefano Stabellini wrote:
> On Wed, 8 Sep 2021, Christoph Hellwig wrote:
>> On Tue, Sep 07, 2021 at 02:13:21PM +0200, Jan Beulich wrote:
>>> The code is unreachable for HVM or PVH, and it also makes little sense
>>> in auto-translated environments. On Arm, with
>>> xen_{create,destroy}_contiguous_region() both being stubs, I have a hard
>>> time seeing what good the Xen specific variant does - the generic one
>>> ought to be fine for all purposes there. Still Arm code explicitly
>>> references symbols here, so the code will continue to be included there.
>>
>> Can the Xen/arm folks look into that?  Getting ARM out of using
>> swiotlb-xen would be a huge step forward cleaning up some DMA APIs.
> 
> On ARM swiotlb-xen is used for a different purpose compared to x86.
> 
> Many ARM SoCs still don't have an IOMMU covering all DMA-mastering
> devices (e.g. Raspberry Pi 4). As a consequence we map Dom0 1:1 (guest
> physical == physical address).
> 
> Now if it was just for Dom0, thanks to the 1:1 mapping, we wouldn't need
> swiotlb-xen. But when we start using PV drivers to share the network or
> disk between Dom0 and DomU we are going to get DomU pages mapped in
> Dom0, we call them "foreign pages".  They are not mapped 1:1. It can
> happen that one of these foreign pages are used for DMA operations
> (e.g. related to the NIC). swiotlb-xen is used to detect these
> situations and translate the guest physical address to physical address
> of foreign pages appropriately.

Hmm, you say "translate", which isn't my understanding of swiotlb's
purpose. As per my understanding swiotlb instead double buffers data
such that is becomes accessible, or suitably arranges underlying
machine addresses. The latter part is clearly a PV-only thing, unused
by Arm as can be seen by there not being any use of XENMEM_exchange.
So it must be the former part that you're talking about, but that's
also the purpose of the non-Xen swiotlb code. If only for my own
education and understanding, could you point me at the difference
between swiotlb-xen and generic swiotlb which addresses this specific
aspect of Arm behavior?

Jan


  reply	other threads:[~2021-09-13  7:28 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 12:03 [PATCH 00/12] swiotlb-xen: fixes and adjustments Jan Beulich
2021-09-07 12:04 ` [PATCH 01/12] swiotlb-xen: avoid double free Jan Beulich
2021-09-08  6:48   ` Christoph Hellwig
2021-09-10 22:55   ` Stefano Stabellini
2021-09-10 22:55     ` Stefano Stabellini
2021-09-07 12:04 ` [PATCH 02/12] swiotlb-xen: fix late init retry Jan Beulich
2021-09-08  6:50   ` Christoph Hellwig
2021-09-07 12:05 ` [PATCH 03/12] swiotlb-xen: maintain slab count properly Jan Beulich
2021-09-08  6:53   ` Christoph Hellwig
2021-09-10 23:10   ` Stefano Stabellini
2021-09-10 23:10     ` Stefano Stabellini
2021-09-07 12:05 ` [PATCH 04/12] swiotlb-xen: ensure to issue well-formed XENMEM_exchange requests Jan Beulich
2021-09-08  6:57   ` Christoph Hellwig
2021-09-08  9:16     ` Jan Beulich
2021-09-10 23:14   ` Stefano Stabellini
2021-09-10 23:14     ` Stefano Stabellini
2021-09-13  7:17     ` Jan Beulich
2021-09-13 20:31       ` Stefano Stabellini
2021-09-13 20:31         ` Stefano Stabellini
2021-09-14  9:11         ` Jan Beulich
2021-09-15  1:22           ` Stefano Stabellini
2021-09-15  1:22             ` Stefano Stabellini
2021-09-15  1:54             ` Stefano Stabellini
2021-09-15  1:54               ` Stefano Stabellini
2021-09-15  8:21               ` Jan Beulich
2021-09-07 12:05 ` [PATCH 05/12] swiotlb-xen: suppress certain init retries Jan Beulich
2021-09-08  6:58   ` Christoph Hellwig
2021-09-10 23:18   ` Stefano Stabellini
2021-09-10 23:18     ` Stefano Stabellini
2021-09-07 12:06 ` [PATCH 06/12] swiotlb-xen: limit " Jan Beulich
2021-09-08  7:00   ` Christoph Hellwig
2021-09-10 23:23   ` Stefano Stabellini
2021-09-10 23:23     ` Stefano Stabellini
2021-09-07 12:06 ` [PATCH 07/12] swiotlb-xen: drop leftover __ref Jan Beulich
2021-09-08  7:02   ` Christoph Hellwig
2021-09-10 23:24   ` Stefano Stabellini
2021-09-10 23:24     ` Stefano Stabellini
2021-09-07 12:07 ` [PATCH 08/12] swiotlb-xen: arrange to have buffer info logged Jan Beulich
2021-09-08  7:04   ` Christoph Hellwig
2021-09-10 23:26   ` Stefano Stabellini
2021-09-10 23:26     ` Stefano Stabellini
2021-09-07 12:07 ` [PATCH 09/12] swiotlb-xen: drop DEFAULT_NSLABS Jan Beulich
2021-09-08  7:06   ` Christoph Hellwig
2021-09-10 23:27   ` Stefano Stabellini
2021-09-10 23:27     ` Stefano Stabellini
2021-09-07 12:10 ` [PATCH 10/12] xen-pcifront: this module is PV-only Jan Beulich
2021-09-07 15:30   ` Bjorn Helgaas
2021-09-07 16:14     ` Jan Beulich
2021-09-07 16:38       ` Bjorn Helgaas
2021-09-10 23:34   ` Stefano Stabellini
2021-09-10 23:34     ` Stefano Stabellini
2021-09-07 12:11 ` [PATCH 11/12] xen/pci-swiotlb: reduce visibility of symbols Jan Beulich
2021-09-08  7:08   ` Christoph Hellwig
2021-09-07 12:13 ` [PATCH 12/12] swiotlb-xen: this is PV-only on x86 Jan Beulich
2021-09-08  7:14   ` Christoph Hellwig
2021-09-10 23:48     ` Stefano Stabellini
2021-09-10 23:48       ` Stefano Stabellini
2021-09-13  7:28       ` Jan Beulich [this message]
2021-09-13 20:54         ` Stefano Stabellini
2021-09-13 20:54           ` Stefano Stabellini
2021-09-13  7:51       ` Jan Beulich
2021-09-13 20:49         ` Stefano Stabellini
2021-09-13 20:49           ` Stefano Stabellini
2021-09-08 15:18 ` [PATCH 00/12] swiotlb-xen: fixes and adjustments Juergen Gross
2021-09-08 15:18   ` Juergen Gross via iommu
2021-09-14  8:30 ` Juergen Gross

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=543b446b-0143-ad32-99ed-d7a6f79381e8@suse.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=hch@infradead.org \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sstabellini@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.