Message ID | cover.f819645cd9f5cf7a6f692f9661cfb4e670a2cd08.1579055705.git-series.marmarek@invisiblethingslab.com (mailing list archive) |
---|---|
Headers | show |
Series | Add support for qemu-xen runnning in a Linux-based stubdomain. | expand |
On Tue, Jan 14, 2020 at 9:42 PM Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> wrote: <snip> > 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. Thanks for working on this! I think the separate process is nicer. > 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. > Beware: building on Debian is dangerous, as it require installing "dracut", > which will remove initramfs-tools. You may end up with broken initrd on > your host. Just as an FYI, Marek's use of dracut is mainly for dracut-install to copy a binary & dependent libraries when generating the initramfs (https://github.com/marmarek/qubes-vmm-xen-stubdom-linux/blob/master/rootfs/gen). The initramfs isn't running dracut scripts. Using initramfs-tools hook-functions:copy_exec() for similar functionality is a possibility. > 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). A mostly unpatched QEMU works for networking & disk. The exception is PCI passthrough, which needs some patches. I tested this by removing patches from Marek's repo, except for the seccomp ones and disable-nic-option-rom.patch. Without disable-nic-option-rom.patch, QEMU fails to start with 'failed to find romfile "efi-rtl8139.rom"' One issue I've noticed is QEMU ~4.1 calls getrandom() during startup. In a stubdom there is insufficient entropy, so QEMU blocks and stubdom startup times out. You can avoid getrandom() blocking with CONFIG_RANDOM_TRUST_CPU or https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50ee7529ec4500c88f8664560770a7a1b65db72b or some other way of adding entropy. Regards, Jason