qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Lopez <slp@redhat.com>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com, ehabkost@redhat.com,
	"Sergio Lopez" <slp@redhat.com>,
	mst@redhat.com, lersek@redhat.com, groug@kaod.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	marcandre.lureau@gmail.com, kraxel@redhat.com,
	pbonzini@redhat.com, imammedo@redhat.com, sgarzare@redhat.com,
	philmd@redhat.com, rth@twiddle.net
Subject: [PATCH v11 13/15] docs/microvm.rst: document the new microvm machine type
Date: Fri, 18 Oct 2019 12:53:13 +0200	[thread overview]
Message-ID: <20191018105315.27511-14-slp@redhat.com> (raw)
In-Reply-To: <20191018105315.27511-1-slp@redhat.com>

Document the new microvm machine type.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 docs/microvm.rst | 108 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)
 create mode 100644 docs/microvm.rst

diff --git a/docs/microvm.rst b/docs/microvm.rst
new file mode 100644
index 0000000000..aae811a922
--- /dev/null
+++ b/docs/microvm.rst
@@ -0,0 +1,108 @@
+====================
+microvm Machine Type
+====================
+
+``microvm`` is a machine type inspired by ``Firecracker`` and
+constructed after its machine model.
+
+It's a minimalist machine type without ``PCI`` nor ``ACPI`` support,
+designed for short-lived guests. microvm also establishes a baseline
+for benchmarking and optimizing both QEMU and guest operating systems,
+since it is optimized for both boot time and footprint.
+
+
+Supported devices
+-----------------
+
+The microvm machine type supports the following devices:
+
+- ISA bus
+- i8259 PIC (optional)
+- i8254 PIT (optional)
+- MC146818 RTC (optional)
+- One ISA serial port (optional)
+- LAPIC
+- IOAPIC (with kernel-irqchip=split by default)
+- kvmclock (if using KVM)
+- fw_cfg
+- Up to eight virtio-mmio devices (configured by the user)
+
+
+Limitations
+-----------
+
+Currently, microvm does *not* support the following features:
+
+ - PCI-only devices.
+ - Hotplug of any kind.
+ - Live migration across QEMU versions.
+
+
+Using the microvm machine type
+------------------------------
+
+Machine-specific options
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+It supports the following machine-specific options:
+
+- microvm.x-option-roms=bool (Set off to disable loading option ROMs)
+- microvm.pit=OnOffAuto (Enable i8254 PIT)
+- microvm.isa-serial=bool (Set off to disable the instantiation an ISA serial port)
+- microvm.pic=OnOffAuto (Enable i8259 PIC)
+- microvm.rtc=OnOffAuto (Enable MC146818 RTC)
+- microvm.auto-kernel-cmdline=bool (Set off to disable adding virtio-mmio devices to the kernel cmdline)
+
+
+Boot options
+~~~~~~~~~~~~
+
+By default, microvm uses ``qboot`` as its BIOS, to obtain better boot
+times, but it's also compatible with ``SeaBIOS``.
+
+As no current FW is able to boot from a block device using
+``virtio-mmio`` as its transport, a microvm-based VM needs to be run
+using a host-side kernel and, optionally, an initrd image.
+
+
+Running a microvm-based VM
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By default, microvm aims for maximum compatibility, enabling both
+legacy and non-legacy devices. In this example, a VM is created
+without passing any additional machine-specific option, using the
+legacy ``ISA serial`` device as console::
+
+  $ qemu-system-x86_64 -M microvm \
+     -enable-kvm -cpu host -m 512m -smp 2 \
+     -kernel vmlinux -append "earlyprintk=ttyS0 console=ttyS0 root=/dev/vda" \
+     -nodefaults -no-user-config -nographic \
+     -serial stdio \
+     -drive id=test,file=test.img,format=raw,if=none \
+     -device virtio-blk-device,drive=test \
+     -netdev tap,id=tap0,script=no,downscript=no \
+     -device virtio-net-device,netdev=tap0
+
+While the example above works, you might be interested in reducing the
+footprint further by disabling some legacy devices. If you're using
+``KVM``, you can disable the ``RTC``, making the Guest rely on
+``kvmclock`` exclusively. Additionally, if your host's CPUs have the
+``TSC_DEADLINE`` feature, you can also disable both the i8259 PIC and
+the i8254 PIT (make sure you're also emulating a CPU with such feature
+in the guest).
+
+This is an example of a VM with all optional legacy features
+disabled::
+
+  $ qemu-system-x86_64 \
+     -M microvm,x-option-roms=off,pit=off,pic=off,isa-serial=off,rtc=off \
+     -enable-kvm -cpu host -m 512m -smp 2 \
+     -kernel vmlinux -append "console=hvc0 root=/dev/vda" \
+     -nodefaults -no-user-config -nographic \
+     -chardev stdio,id=virtiocon0 \
+     -device virtio-serial-device \
+     -device virtconsole,chardev=virtiocon0 \
+     -drive id=test,file=test.img,format=raw,if=none \
+     -device virtio-blk-device,drive=test \
+     -netdev tap,id=tap0,script=no,downscript=no \
+     -device virtio-net-device,netdev=tap0
-- 
2.21.0



  parent reply	other threads:[~2019-10-18 11:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 10:53 [PATCH v11 00/15] Introduce the microvm machine type Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 01/15] hw/virtio: Factorize virtio-mmio headers Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 02/15] hw/i386/pc: rename functions shared with non-PC machines Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 03/15] hw/i386/pc: fix code style issues on functions that will be moved out Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 04/15] hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux() Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 05/15] hw/i386/pc: avoid an assignment in if condition " Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 06/15] hw/i386/pc: remove commented out code from x86_load_linux() Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 07/15] hw/i386/pc: move shared x86 functions to x86.c and export them Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 08/15] hw/i386: split PCMachineState deriving X86MachineState from it Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 09/15] hw/i386: make x86.c independent from PCMachineState Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 10/15] fw_cfg: add "modify" functions for all types Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 11/15] hw/intc/apic: reject pic ints if isa_pic == NULL Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 12/15] roms: add microvm-bios (qboot) as binary and git submodule Sergio Lopez
2019-10-18 10:53 ` Sergio Lopez [this message]
2019-10-18 10:53 ` [PATCH v11 14/15] hw/i386: Introduce the microvm machine type Sergio Lopez
2019-10-30  9:25   ` Philippe Mathieu-Daudé
2019-10-30 14:18     ` Paolo Bonzini
2019-10-18 10:53 ` [PATCH v11 15/15] MAINTAINERS: add microvm related files Sergio Lopez
2019-11-27 15:41 ` [PATCH v11 00/15] Introduce the microvm machine type Markus Armbruster
2019-12-02 13:01   ` Sergio Lopez

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=20191018105315.27511-14-slp@redhat.com \
    --to=slp@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sgarzare@redhat.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).