All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain.
@ 2018-08-07  2:16 Marek Marczykowski-Górecki
  2018-08-07  2:16 ` [RFC PATCH v2 01/17] libxl: fix qemu-trad cmdline for no sdl/vnc case Marek Marczykowski-Górecki
                   ` (17 more replies)
  0 siblings, 18 replies; 85+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-08-07  2:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Simon Gaiser, Wei Liu, Ian Jackson,
	Marek Marczykowski-Górecki, Eric Shelton

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.
Right now when qemu-xen in stubdomain is selected, it is assumed it's
Linux-based and few decisions are based on it, specifically:
 - qemu args encoding (\x1b as separator, to allow spaces in arguments)
 - save/restore stream access (specific FDs passed to qemu by a wrapper script)
 - QMP access, if any

It may be a good idea to document "stubdomain API" somewhere. Is there such
document for MiniOS one? Here is an initial version for Linux one:

    Assumptions about Linux-based stubdomain for qemu-xen:
    * qemu command line is stored by toolstack in
      /vm/<target-uuid>/image/dmargs xenstore entry, arguments are separated
      with \x1b character
    * qemu can access saved state (if any) at its FD 3
    * qemu can write its state (for save/migration) to its FD 4
    * qemu expects backend for serial console at /dev/hvc3
    * disks configured for the target are available as /dev/xvd*, in
      configuration order
    * qemu can call /etc/qemu-ifup and /etc/qemu-ifdown to connect/disconnect
      network interface to appropriate network

Initial version has no QMP support - in initial patches it is completely
disabled, which means no suspend/restore. QMP normally would be used for PCI
passthrough setup, but it is worked around with MiniOS-like control protocol
over xenstore, which then is translated to QMP on stubdomain side.
Some option is to use separate console for that, but that require
xenstoled supporting multiple consoles per domain (the goal is to not have qemu
in dom0 at all). Also, it would be preferable to evaluate how libxl
handle potentially malicious QMP responses.
Another option is to use xenstore - either translate everything needed to
MiniOS-like thing, or write already json-formatted requests to xenstore and
watch there for responses. When using separate xenstore dir for that, with
per-command entries (command id as a key name?) that would solve concurrency
problem.

QMP support over separate console: patch "libxl: access QMP socket via console
for qemu-in-stubdomain" implements some early PoC of this.
Major limitation: only one connection at a time and no means of out of
band reset (and re-negotiate). I've tried adding very simple `qmp_reset`
command for in-band connection reset, but it is unreliable because of the
first limitation - xl process running in background hold this connection open
and every other xl instance interfere with it. On the other hand, for libvirt
use case one connection could be enough (leaving alone libvirtd restart).

Xenconsoled patches add support for multiple consoles in xenconsoled, to avoid the need
for qemu in dom0 for this to work. Multiple consoles for a stubdomain are used for:
 - logs (console 0)
 - save + restore (console 1, 2)
 - qmp (console 3)
 - serial terminal to target domU (console 4)
Xenconsoled patches are in fact a separate series, but I'm sending them here to
ease dependencies handling (latter libxl patches use that).

What qmp-libxenstat socket is for?

PCI passthrough support require some more love. Right now, libxl tries to setup
pcifront for both target HVM and stubdomain and the former fails (race
condition):
    xen-pciback pci-259-0: 22 Couldn't locate PCI device (0000:00:1b.0)! perhaps already in-use?
Fortunately it isn't needed. There is also a PCI related problem on
domain shutdown - it looks like first stubdomain is paused and then libxl waits
for pcifront there.
Also, MSI doesn't work (qemu output):

    [00:05.0] xen_pt_msgctrl_reg_write: setup MSI (register: 81).
    [00:05.0] msi_msix_setup: requested pirq 55 for MSI (vec: 0, entry: 0)
    [00:05.0] msi_msix_setup: Error: Mapping of MSI (err: 1, vec: 0, entry 0)
    [00:05.0] xen_pt_msgctrl_reg_write: Warning: Can not map MSI (register: 80)!
    [00:05.0] Write-back to unknown field 0x44 (partially) inhibited (0x00)
    [00:05.0] If the device doesn't work, try enabling permissive mode
    [00:05.0] (unsafe) and if it helps report the problem to xen-devel

The actual stubdomain implementation is here:

    https://github.com/marmarek/qubes-vmm-xen-stubdom-linux (branch for-upstream)

See readme there for build instructions.

Remaining parts for eliminating dom0's instance of qemu:
 - do not force QDISK backend for CDROM

This patch series is third (fourth?) attempt to get rid of limitation
"if you want to use stubdomain, you're stuck with qemu-traditional", done over
years, by many people.
I think it should be acceptable plan to gradually add features to
qemu-xen+stubdomain configuration - not necessary waiting with committing any
of those patches until full feature set of qemu-xen is supported. After all,
right now "feature set supported by qemu-xen+stubdom" is empty, so wouldn't be
worse.

Changes in v2:
 - apply review comments by Jason Andryuk

Cc: Simon Gaiser <simon@invisiblethingslab.com>
Cc: Eric Shelton <eshelton@pobox.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>

Eric Shelton (3):
  libxl: Add "stubdomain_version" to domain_build_info.
  libxl: Handle Linux stubdomain specific QEMU options.
  libxl: Build the domain with a Linux based stubdomain

Marek Marczykowski-Górecki (13):
  libxl: fix qemu-trad cmdline for no sdl/vnc case
  libxl: create vkb device only for guests with graphics output
  libxl: add save/restore support for qemu-xen in stubdomain
  xl: add stubdomain related options to xl config parser
  libxl: use \x1b to separate qemu arguments for linux stubdomain
  xenconsoled: install xenstore watch for all supported consoles
  xenconsoled: add support for consoles using 'state' xenstore entry
  xenconsoled: make console_type->use_gnttab less confusing
  xenconsoled: add support for up to 3 secondary consoles
  xenconsoled: deduplicate error handling
  xenconsoled: add support for non-pty output
  libxl: access QMP socket via console for qemu-in-stubdomain
  libxl: use xenconsoled even for multiple stubdomain's consoles

Simon Gaiser (1):
  libxl: use xenstore for pci hotplug qemu-in-linux-stubdom commands

 docs/man/xl.cfg.pod.5.in        |  23 ++-
 tools/console/daemon/io.c       | 222 ++++++++++++++++++++++++++++-----
 tools/libxl/libxl_create.c      |  83 ++++++++++--
 tools/libxl/libxl_dm.c          | 190 +++++++++++++++++++---------
 tools/libxl/libxl_dom_suspend.c |  10 +-
 tools/libxl/libxl_internal.c    |  22 +++-
 tools/libxl/libxl_internal.h    |   9 +-
 tools/libxl/libxl_mem.c         |   6 +-
 tools/libxl/libxl_pci.c         |  22 ++-
 tools/libxl/libxl_qmp.c         |  52 +++++++-
 tools/libxl/libxl_types.idl     |  10 +-
 tools/xl/xl_parse.c             |   7 +-
 12 files changed, 546 insertions(+), 110 deletions(-)

base-commit: e752f28409678ce3ade49986b39309178fb2a6d6
-- 
git-series 0.9.1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 85+ messages in thread

end of thread, other threads:[~2019-01-09 12:21 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-07  2:16 [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 01/17] libxl: fix qemu-trad cmdline for no sdl/vnc case Marek Marczykowski-Górecki
2018-08-09  9:19   ` Wei Liu
2018-10-16 16:55   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 02/17] libxl: Add "stubdomain_version" to domain_build_info Marek Marczykowski-Górecki
2018-08-09  9:25   ` Wei Liu
2018-09-03 22:25     ` Marek Marczykowski-Górecki
2018-10-16 16:43       ` Ian Jackson
2018-10-16 17:36         ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 03/17] libxl: Handle Linux stubdomain specific QEMU options Marek Marczykowski-Górecki
2018-08-09  9:31   ` Wei Liu
2018-08-09 16:23   ` Jason Andryuk
2018-10-16 17:16   ` Ian Jackson
2018-10-16 17:51     ` Marek Marczykowski-Górecki
2018-10-19  9:32     ` Roger Pau Monné
2018-08-07  2:16 ` [RFC PATCH v2 04/17] libxl: Build the domain with a Linux based stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 05/17] libxl: use xenstore for pci hotplug qemu-in-linux-stubdom commands Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 06/17] libxl: create vkb device only for guests with graphics output Marek Marczykowski-Górecki
2018-11-01 17:05   ` Ian Jackson
2018-11-01 20:24     ` Stefano Stabellini
2018-08-07  2:16 ` [RFC PATCH v2 07/17] libxl: add save/restore support for qemu-xen in stubdomain Marek Marczykowski-Górecki
2018-11-01 17:11   ` Ian Jackson
2018-11-01 17:16     ` Marek Marczykowski-Górecki
2018-11-01 17:41       ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 08/17] xl: add stubdomain related options to xl config parser Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 09/17] libxl: use \x1b to separate qemu arguments for linux stubdomain Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 10/17] xenconsoled: install xenstore watch for all supported consoles Marek Marczykowski-Górecki
2018-09-19 17:43   ` Wei Liu
2018-08-07  2:16 ` [RFC PATCH v2 11/17] xenconsoled: add support for consoles using 'state' xenstore entry Marek Marczykowski-Górecki
2018-11-01 17:21   ` Ian Jackson
2019-01-09 12:21     ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 12/17] xenconsoled: make console_type->use_gnttab less confusing Marek Marczykowski-Górecki
2018-11-01 17:25   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles Marek Marczykowski-Górecki
2018-11-01 17:31   ` Ian Jackson
2018-11-01 18:25     ` Marek Marczykowski-Górecki
2018-11-02 17:50       ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles [and 1 more messages] Ian Jackson
2018-11-01 20:27     ` [RFC PATCH v2 13/17] xenconsoled: add support for up to 3 secondary consoles Stefano Stabellini
2018-08-07  2:16 ` [RFC PATCH v2 14/17] xenconsoled: deduplicate error handling Marek Marczykowski-Górecki
2018-11-01 17:31   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 15/17] xenconsoled: add support for non-pty output Marek Marczykowski-Górecki
2018-11-01 17:35   ` Ian Jackson
2018-11-01 17:54     ` Marek Marczykowski-Górecki
2018-08-07  2:16 ` [RFC PATCH v2 16/17] libxl: access QMP socket via console for qemu-in-stubdomain Marek Marczykowski-Górecki
2018-11-01 17:38   ` Ian Jackson
2018-08-07  2:16 ` [RFC PATCH v2 17/17] libxl: use xenconsoled even for multiple stubdomain's consoles Marek Marczykowski-Górecki
2018-10-16 16:53 ` [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Ian Jackson
2018-10-16 17:32   ` Marek Marczykowski-Górecki
2018-10-16 17:52     ` Ian Jackson
2018-10-16 20:46       ` Marek Marczykowski-Górecki
2018-10-17 10:17         ` Ian Jackson
2018-10-17 15:16         ` Ian Jackson
2018-10-17 16:05           ` Marek Marczykowski-Górecki
2018-11-01 16:57             ` Ian Jackson
2018-11-01 17:32               ` Marek Marczykowski-Górecki
2018-11-01 17:48                 ` Ian Jackson
2018-11-01 18:04                   ` Marek Marczykowski-Górecki
2018-11-02 16:53                     ` Ian Jackson
2018-11-02 17:01                       ` [PATCH 0/8] libvchan: Minor improvements Ian Jackson
2018-11-02 17:01                         ` [PATCH 1/8] tools/libvchan: Initialise xs_transaction_t to XBT_NULL, not NULL Ian Jackson
2018-11-06  9:40                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 2/8] tools/xenstore: Document that xs_close(0) is OK Ian Jackson
2018-11-06  9:41                           ` Wei Liu
2018-11-28 11:41                             ` Wei Liu
2018-11-02 17:01                         ` [PATCH 3/8] tools/libvchan: init_xs_srv: Simplify error handling (1) Ian Jackson
2018-11-06  9:47                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 4/8] tools/libvchan: init_xs_srv: Simplify error handling (2) Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-06 11:42                             ` Ian Jackson
2018-11-02 17:01                         ` [PATCH 5/8] tools/libvchan: init_xs_srv: Turn xs retry from goto into for (; ; ) Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 6/8] tools/libvchan: Add xentoollog to direct dependencies Ian Jackson
2018-11-06  9:48                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 7/8] tools/libvchan: libxenvchan_*_init: Promise an errno Ian Jackson
2018-11-06  9:49                           ` Wei Liu
2018-11-02 17:01                         ` [PATCH 8/8] tools/libvchan: libxenvchan_client_init: use ENOENT for no server Ian Jackson
2018-11-06 10:00                           ` Wei Liu
2018-11-06 11:45                             ` Ian Jackson
2018-11-06 12:15                               ` Marek Marczykowski-Górecki
2018-11-06 15:57                                 ` Ian Jackson
2018-11-15 17:41                 ` [RFC PATCH v2 00/17] Add support for qemu-xen runnning in a Linux-based stubdomain Anthony PERARD
2018-11-15 18:57                   ` Marek Marczykowski-Górecki
2018-11-16 10:39                     ` Anthony PERARD
2018-11-18 17:25                       ` Marek Marczykowski-Górecki
2018-11-19 12:03                         ` Anthony PERARD

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.