From: David Woodhouse <dwmw2@infradead.org>
To: Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>
Cc: Vikram Garhwal <vikram.garhwal@amd.com>,
qemu-devel@nongnu.org, paul <paul@xen.org>
Subject: Re: [QEMU][PATCHv2 0/8] Xen: support grant mappings.
Date: Mon, 13 Nov 2023 15:24:40 -0500 [thread overview]
Message-ID: <8cc48dd19e33be3c40ef6ff96bf7dd5d492186ae.camel@infradead.org> (raw)
In-Reply-To: <9b9543b1-b1a7-4699-89f5-2e87680d52e8@suse.com>
[-- Attachment #1: Type: text/plain, Size: 2609 bytes --]
On Fri, 2023-10-27 at 07:27 +0200, Juergen Gross wrote:
> On 26.10.23 22:56, Stefano Stabellini wrote:
> > On Thu, 26 Oct 2023, David Woodhouse wrote:
> > > On Thu, 2023-10-26 at 13:36 -0700, Stefano Stabellini wrote:
> > > >
> > > > > This seems like a lot of code to replace that simpler option... is
> > > > > there a massive performance win from doing it this way? Would we want
> > > > > to use this trick for the Xen PV backends (qdisk, qnic) *too*? Might it
> > > > > make sense to introduce the simple version and *then* the optimisation,
> > > > > with some clear benchmarking to show the win?
> > > >
> > > > This is not done for performance but for safety (as in safety
> > > > certifications, ISO 26262, etc.). This is to enable unprivileged virtio
> > > > backends running in a DomU. By unprivileged I mean a virtio backend that
> > > > is unable to map arbitrary memory (the xenforeignmemory interface is
> > > > prohibited).
> > > >
> > > > The goal is to run Xen on safety-critical systems such as cars,
> > > > industrial robots and more. In this configuration there is no
> > > > traditional Dom0 in the system at all. If you would like to know more:
> > > > https://www.youtube.com/watch?v=tisljY6Bqv0&list=PLYyw7IQjL-zHtpYtMpFR3KYdRn0rcp5Xn&index=8
> > >
> > > Yeah, I understand why we're using grant mappings instead of just
> > > directly having access via foreignmem mappings. That wasn't what I was
> > > confused about.
> > >
> > > What I haven't worked out is why we're implementing this through an
> > > automatically-populated MemoryRegion in QEMU, rather than just using
> > > grant mapping ops like we always have.
> > >
> > > It seems like a lot of complexity just to avoid calling
> > > qemu_xen_gnttab_map_refs() from the virtio backend.
> >
> > I think there are two questions here. One question is "Why do we need
> > all the new grant mapping code added to xen-mapcache.c in patch #7?
> > Can't we use qemu_xen_gnttab_map_refs() instead?"
>
> The main motivation was to _avoid_ having to change all the backends.
>
> My implementation enables _all_ qemu based virtio backends to use grant
> mappings. And if a new backend is added to qemu, there will be no change
> required to make it work with grants.
I'm not really convinced I buy that. This is a lot of complexity, and
don't backends need to call an appropriate mapping function to map via
an IOMMU if it's present anyway? Make then call a helper where you can
do this in one place directly instead of through a fake MemoryRegion,
and you're done, surely?
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5965 bytes --]
next prev parent reply other threads:[~2023-11-13 20:25 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-25 21:24 [QEMU][PATCHv2 0/8] Xen: support grant mappings Vikram Garhwal
2023-10-25 21:24 ` [QEMU][PATCHv2 1/8] xen: when unplugging emulated devices skip virtio devices Vikram Garhwal
2023-10-25 23:22 ` David Woodhouse
2023-10-26 1:23 ` Stefano Stabellini
2023-10-26 15:45 ` David Woodhouse
2023-10-26 17:13 ` Vikram Garhwal
2023-10-25 21:24 ` [QEMU][PATCHv2 2/8] softmmu: physmem: Split ram_block_add() Vikram Garhwal
2023-10-26 1:25 ` Stefano Stabellini
2023-10-25 21:24 ` [QEMU][PATCHv2 3/8] xen: add pseudo RAM region for grant mappings Vikram Garhwal
2023-10-26 1:27 ` Stefano Stabellini
2023-10-25 21:24 ` [QEMU][PATCHv2 4/8] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length() Vikram Garhwal
2023-10-26 1:28 ` Stefano Stabellini
2023-10-25 21:24 ` [QEMU][PATCHv2 5/8] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry Vikram Garhwal
2023-10-25 21:24 ` [QEMU][PATCHv2 6/8] memory: add MemoryRegion map and unmap callbacks Vikram Garhwal
2023-10-25 21:24 ` [QEMU][PATCHv2 7/8] xen: add map and unmap callbacks for grant region Vikram Garhwal
2023-10-26 1:32 ` Stefano Stabellini
2023-10-26 4:35 ` Vikram Garhwal
2023-10-25 21:24 ` [QEMU][PATCHv2 8/8] hw: arm: Add grant mapping Vikram Garhwal
2023-10-26 16:12 ` [QEMU][PATCHv2 0/8] Xen: support grant mappings David Woodhouse
2023-10-26 18:07 ` Stefano Stabellini
2023-10-26 20:15 ` David Woodhouse
2023-10-26 20:36 ` Stefano Stabellini
2023-10-26 20:44 ` David Woodhouse
2023-10-26 20:56 ` Stefano Stabellini
2023-10-27 5:27 ` Juergen Gross
2023-11-13 20:24 ` David Woodhouse [this message]
2023-11-14 6:19 ` Juergen Gross
2023-11-14 20:58 ` Stefano Stabellini
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=8cc48dd19e33be3c40ef6ff96bf7dd5d492186ae.camel@infradead.org \
--to=dwmw2@infradead.org \
--cc=jgross@suse.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=vikram.garhwal@amd.com \
/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;
as well as URLs for NNTP newsgroup(s).