vHost profiles
Every machine has one QEMU vHost process. Its template renders YAML fields into a QEMU command line, binds the memory pool, and exposes QMP and serial.
Role in a topology
A machine has exactly one vHost; its kind must use
model: qemu, and the repository ships onlyqemu-vhost.resources/vhosts/qemu.yamldeclaresqemu-vhost: the command template renders with MiniJinja, binds the memory pool, exposes QMP and the serial console, gives every device its own PCIe root port at slots0x10to0x17(eight functions), and lets QEMU place disks in the remaining slots.The kind declares
max_devices: 64; a machine may not exceed that number of devices.The vHost starts only after every local device is ready and has handed over its lease; devices stop after the vHost has shut down.
Every vHost program must stay in the foreground, keep its resource users in its process group and keep inherited file descriptors open; QEMU
-daemonizeis rejected.
vHost fields
Field |
Type |
Default |
Description |
|---|---|---|---|
|
string |
none |
Must resolve to a vHost kind with |
|
path or name |
none |
Relative to the workspace root; a bare name is looked up in |
|
map |
|
Processes additionally receive only |
|
byte size |
none |
Must be a multiple of the execution page size |
|
positive integer |
none |
Passed to QEMU |
|
string |
none |
For example |
|
string |
none |
QEMU machine type, for example |
|
string |
none |
Passed to |
|
string |
none |
QEMU backends; the samples use |
|
bool |
|
Adds |
|
byte size |
2 MiB |
Power of two; also the default alignment of device regions |
|
MiniJinja template |
none |
Required when the machine has a gem5-mi300x device |
|
string, 1 to 86400 seconds |
none, the session |
Serial readiness marker and deadline |
|
list |
|
Appended to the end of the QEMU command line |
Shipped profiles
The five profiles are defined under resources/vhosts/ and selected by a machine through use.
vhost-x86
q35,kvm,hostCPU, 8 GiB RAM, 4 vCPU; binarybuild/qemu/qemu-system-x86_64.memory_mapdescribes the x86_64 PCI hole: when RAM is at least 2.75 GiB, 2 GiB stay below 4 GiB and the rest goes above 4 GiB.Provides the base x86_64 KVM runtime settings. The consuming vHost configuration declares its image and boot inputs.
vhost-x86-rocm
Inherits
vhost-x86and selectsubuntu/24.04/x86_64/rocm/7.0throughimage.Configures a virtio root disk and kernel arguments for the serial console, root filesystem and
modprobe.blacklist=amdgpu.single-gpu,gpu-8andmixed-modelsuse this profile to boot the ROCm guest.The recipe defines software installation and results; this profile defines simulation-session boot settings.
vhost-arm
virt,gic-version=3,kvm,hostCPU, 8 GiB RAM, 4 vCPU; binarybuild/qemu/qemu-system-aarch64.memory_mapplaces RAM at 1 GiB.No sample uses this KVM profile directly; it is only the base template of
vhost-arm-tcg.
vhost-x86-tcg
Inherits
vhost-x86and overrides it withtcg,qemu64, 64 MiB RAM and 1 vCPU.The binary is the bare name
qemu-system-x86_64, looked up inPATHduring planning.argsis[-S, -nodefaults], so the vHost stays paused; used for sessions that do not boot an OS.
vhost-arm-tcg
Inherits
vhost-armand overrides it withtcg,cortex-a72, 64 MiB RAM and 1 vCPU.The binary is the bare name
qemu-system-aarch64;argsis[-S, -nodefaults].The AArch64 samples and architecture-dependent session tests use this profile.
QEMU command contract
The vHost kind renders QEMU arguments from a command template whose context
includes vhost, machine, pool, ram, guest_ranges,
boot, disks, devices, qmp, serial, serial_log,
cmdline, run_dir and node_dir.
-machine <machine>,memory-backend=ram,-accel,-mand-smp;memory-backend-file(share=on, offset at the guest RAM offset) binding the pool;a QMP Unix socket; a serial chardev with a logfile;
optional
-cpu,-display,-monitorand-append;-kerneland-initrdwhen the vHost haskernel;-no-rebootwhenno_rebootis set;one
pcie-root-portand onevfio-user-pciclient per device (withromfilewhenpci.romis set);virtio-scsi-pciwhen a SCSI disk exists; disks first become-blockdevfile and format nodes, then map tovirtio-blk-pci,nvme,scsi-hdoride-hdbybus, withbootindex=1on the boot disk;vhost.argsappended last.
Readiness probes run in order: the serial socket exists, QMP negotiation succeeds, and the optional serial.wait_for log marker appears. Undefined template values are errors rather than empty strings.
Memory map
memory_mapis a MiniJinja template that receivesvhostandram.sizeand renders 1 to 64 ordered, non-overlapping ranges.A machine with a gem5 MI300X device must provide
memory_map; machines with QEMU devices only do not need it.QEMU maps guest RAM through
memory-backend-file; gem5 receives--host-memory-rangesand--shared-pooland maps the same pool file. The address space is described in Memory and shared memory model.
Serial and readiness deadline
serial.wait_foradds a serial readiness marker;serial.timeoutlimits that marker in seconds, measured from vHost start, and requireswait_for.Without
serial.timeoutthe session--ready-timeoutapplies (default 120 seconds).A vHost exiting with status 0 ends its machine; any other exit, a failed probe or cancellation ends the whole session.