From: Jason Andryuk <jandryuk@gmail.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Simon Gaiser" <simon@invisiblethingslab.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Anthony PERARD" <anthony.perard@citrix.com>,
"Ian Jackson" <ian.jackson@citrix.com>,
"Eric Shelton" <eshelton@pobox.com>
Subject: Re: [PATCH v5 00/21] Add support for qemu-xen runnning in a Linux-based stubdomain
Date: Mon, 11 May 2020 16:19:00 -0400 [thread overview]
Message-ID: <CAKf6xptOrADAOfiFsjKknw9j5qcO4k+c=AQxDLFDt+u2N3y5vQ@mail.gmail.com> (raw)
In-Reply-To: <20200428040433.23504-1-jandryuk@gmail.com>
Ping?
-Jason
On Tue, Apr 28, 2020 at 12:05 AM Jason Andryuk <jandryuk@gmail.com> wrote:
>
> Hi,
>
> In coordination with Marek, I'm making a submission of his patches for Linux
> stubdomain device-model support. I made a few of my own additions, but Marek
> did the heavy lifting. Thank you, Marek.
>
> Below is mostly the v4 cover leter with a few additions.
>
> General idea is to allow freely set device_model_version and
> device_model_stubdomain_override and choose the right options based on this
> choice. Also, allow to specific path to stubdomain kernel/ramdisk, for greater
> flexibility.
>
> First two patches add documentation about expected toolstack-stubdomain-qemu
> interface, both for MiniOS stubdomain and Linux stubdomain.
>
> Initial version has no QMP support - in initial patches it is completely
> disabled, which means no suspend/restore and no PCI passthrough.
>
> Later patches add QMP over libvchan connection support. The actual connection
> is made in a separate process. As discussed on Xen Summit 2019, this allows to
> apply some basic checks and/or filtering (not part of this series), to limit
> libxl exposure for potentially malicious stubdomain.
>
> Jason's additions ensure the qmp-proxy (vchan-socket-proxy) processes and
> sockets are cleaned up and add some documentation.
>
> The actual stubdomain implementation is here:
>
> https://github.com/marmarek/qubes-vmm-xen-stubdom-linux
> (branch for-upstream, tag for-upstream-v3)
>
> See readme there for build instructions. Marek's version requires dracut. I
> have hacked up a version usable install with initramfs-tools:
>
> https://github.com/jandryuk/qubes-vmm-xen-stubdom-linux
> (branch initramfs-tools)
>
> Few comments/questions about the stubdomain code:
>
> 1. There are extra patches for qemu that are necessary to run it in stubdomain.
> While it is desirable to upstream them, I think it can be done after merging
> libxl part. Stubdomain's qemu build will in most cases be separate anyway, to
> limit qemu's dependencies (so the stubdomain size).
>
> 2. By default Linux hvc-xen console frontend is unreliable for data transfer
> (qemu state save/restore) - it drops data sent faster than client is reading
> it. To fix it, console device needs to be switched into raw mode (`stty raw
> /dev/hvc1`). Especially for restoring qemu state it is tricky, as it would need
> to be done before opening the device, but stty (obviously) needs to open the
> device first. To solve this problem, for now the repository contains kernel
> patch which changes the default for all hvc consoles. Again, this isn't
> practical problem, as the kernel for stubdomain is built separately. But it
> would be nice to have something working with vanilla kernel. I see those
> options:
> - convert it to kernel cmdline parameter (hvc_console_raw=1 ?)
> - use channels instead of consoles (and on the kernel side change the default
> to "raw" only for channels); while in theory better design, libxl part will
> be more complex, as channels can be connected to sockets but not files, so
> libxl would need to read/write to it exactly when qemu write/read the data,
> not before/after as it is done now
>
> 3. Mini-OS stubdoms use dmargs xenstore key as a string. Linux stubdoms use
> dmargs as a directory for numbered entries. Should they be different names?
>
> Remaining parts for eliminating dom0's instance of qemu:
> - do not force QDISK backend for CDROM
> - multiple consoles support in xenconsoled
>
> Changes in v2:
> - apply review comments by Jason Andryuk
> Changes in v3:
> - rework qemu arguments handling (separate xenstore keys, instead of \x1b separator)
> - add QMP over libvchan, instead of console
> - add protocol documentation
> - a lot of minor changes, see individual patches for full changes list
> - split xenconsoled patches into separate series
> Changes in v4:
> - extract vchan connection into a separate process
> - rebase on master
> - various fixes
> Changes in v5:
> - Marek: apply review comments from Jason Andryuk
> - Jason: Clean up qmp-proxy processes and sockets
>
> Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Cc: Simon Gaiser <simon@invisiblethingslab.com>
> Cc: Eric Shelton <eshelton@pobox.com>
> Cc: Ian Jackson <ian.jackson@citrix.com>
> Cc: Wei Liu <wl@xen.org>
>
> Eric Shelton (1):
> libxl: Handle Linux stubdomain specific QEMU options.
>
> Jason Andryuk (5):
> docs: Add device-model-domid to xenstore-paths
> libxl: Check stubdomain kernel & ramdisk presence
> libxl: Refactor kill_device_model to libxl__kill_xs_path
> libxl: Kill vchan-socket-proxy when cleaning up qmp
> tools: Clean up vchan-socket-proxy socket
>
> Marek Marczykowski-Górecki (15):
> Document ioemu MiniOS stubdomain protocol
> Document ioemu Linux stubdomain protocol
> libxl: fix qemu-trad cmdline for no sdl/vnc case
> libxl: Allow running qemu-xen in stubdomain
> libxl: write qemu arguments into separate xenstore keys
> xl: add stubdomain related options to xl config parser
> tools/libvchan: notify server when client is connected
> libxl: add save/restore support for qemu-xen in stubdomain
> tools: add missing libxenvchan cflags
> tools: add simple vchan-socket-proxy
> libxl: use vchan for QMP access with Linux stubdomain
> Regenerate autotools files
> libxl: require qemu in dom0 even if stubdomain is in use
> libxl: ignore emulated IDE disks beyond the first 4
> libxl: consider also qemu in stubdomain in libxl__dm_active check
>
> .gitignore | 1 +
> configure | 14 +-
> docs/configure | 14 +-
> docs/man/xl.cfg.5.pod.in | 27 +-
> docs/misc/stubdom.txt | 103 ++++++
> docs/misc/xenstore-paths.pandoc | 5 +
> stubdom/configure | 14 +-
> tools/Rules.mk | 2 +-
> tools/config.h.in | 3 +
> tools/configure | 46 ++-
> tools/configure.ac | 9 +
> tools/libvchan/Makefile | 8 +-
> tools/libvchan/init.c | 3 +
> tools/libvchan/vchan-socket-proxy.c | 500 ++++++++++++++++++++++++++++
> tools/libxl/libxl_aoutils.c | 32 ++
> tools/libxl/libxl_create.c | 46 ++-
> tools/libxl/libxl_dm.c | 484 +++++++++++++++++++++------
> tools/libxl/libxl_domain.c | 7 +
> tools/libxl/libxl_internal.h | 22 ++
> tools/libxl/libxl_mem.c | 6 +-
> tools/libxl/libxl_qmp.c | 27 +-
> tools/libxl/libxl_types.idl | 3 +
> tools/xl/xl_parse.c | 7 +
> 23 files changed, 1205 insertions(+), 178 deletions(-)
> create mode 100644 tools/libvchan/vchan-socket-proxy.c
>
> --
> 2.20.1
>
next prev parent reply other threads:[~2020-05-11 20:19 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 4:04 [PATCH v5 00/21] Add support for qemu-xen runnning in a Linux-based stubdomain Jason Andryuk
2020-04-28 4:04 ` [PATCH v5 01/21] Document ioemu MiniOS stubdomain protocol Jason Andryuk
2020-05-14 16:08 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 02/21] Document ioemu Linux " Jason Andryuk
2020-05-14 16:08 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 03/21] libxl: fix qemu-trad cmdline for no sdl/vnc case Jason Andryuk
2020-04-28 4:04 ` [PATCH v5 04/21] libxl: Allow running qemu-xen in stubdomain Jason Andryuk
2020-05-14 16:10 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 05/21] libxl: Handle Linux stubdomain specific QEMU options Jason Andryuk
2020-05-14 16:19 ` Ian Jackson
2020-05-17 13:55 ` Jason Andryuk
2020-04-28 4:04 ` [PATCH v5 06/21] libxl: write qemu arguments into separate xenstore keys Jason Andryuk
2020-05-14 16:25 ` Ian Jackson
2020-05-17 14:29 ` Jason Andryuk
2020-04-28 4:04 ` [PATCH v5 07/21] xl: add stubdomain related options to xl config parser Jason Andryuk
2020-05-14 16:26 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 08/21] tools/libvchan: notify server when client is connected Jason Andryuk
2020-05-14 16:27 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain Jason Andryuk
2020-05-14 16:35 ` Ian Jackson
2020-05-17 13:55 ` Jason Andryuk
2020-05-18 14:15 ` Ian Jackson
2020-05-18 14:50 ` Marek Marczykowski-Górecki
2020-05-18 15:18 ` [PATCH v5 09/21] libxl: add save/restore support for qemu-xen in stubdomain [and 1 more messages] Ian Jackson
2020-05-18 15:48 ` Jason Andryuk
2020-05-18 16:37 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 10/21] tools: add missing libxenvchan cflags Jason Andryuk
2020-05-14 16:35 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 11/21] tools: add simple vchan-socket-proxy Jason Andryuk
2020-05-14 16:37 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 12/21] libxl: use vchan for QMP access with Linux stubdomain Jason Andryuk
2020-05-14 16:39 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 13/21] Regenerate autotools files Jason Andryuk
2020-05-14 16:41 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 14/21] libxl: require qemu in dom0 even if stubdomain is in use Jason Andryuk
2020-05-14 16:42 ` Ian Jackson
2020-05-14 17:36 ` Marek Marczykowski-Górecki
2020-04-28 4:04 ` [PATCH v5 15/21] libxl: ignore emulated IDE disks beyond the first 4 Jason Andryuk
2020-05-14 16:43 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 16/21] libxl: consider also qemu in stubdomain in libxl__dm_active check Jason Andryuk
2020-05-14 16:43 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 17/21] docs: Add device-model-domid to xenstore-paths Jason Andryuk
2020-05-14 16:44 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 18/21] libxl: Check stubdomain kernel & ramdisk presence Jason Andryuk
2020-05-14 16:45 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 19/21] libxl: Refactor kill_device_model to libxl__kill_xs_path Jason Andryuk
2020-05-14 16:45 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 20/21] libxl: Kill vchan-socket-proxy when cleaning up qmp Jason Andryuk
2020-05-14 16:47 ` Ian Jackson
2020-04-28 4:04 ` [PATCH v5 21/21] tools: Clean up vchan-socket-proxy socket Jason Andryuk
2020-05-14 16:48 ` Ian Jackson
2020-05-11 20:19 ` Jason Andryuk [this message]
2020-05-14 16:07 ` [PATCH v5 00/21] Add support for qemu-xen runnning in a Linux-based stubdomain Ian Jackson
2020-05-14 16:55 ` Ian Jackson
2020-05-14 19:10 ` Jason Andryuk
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='CAKf6xptOrADAOfiFsjKknw9j5qcO4k+c=AQxDLFDt+u2N3y5vQ@mail.gmail.com' \
--to=jandryuk@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=eshelton@pobox.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=marmarek@invisiblethingslab.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=simon@invisiblethingslab.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.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;
as well as URLs for NNTP newsgroup(s).