Introducing guest driven VM launch update mechanism (BYOF interface)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest11 patches 2 repliesIn review
- v511 patches 0 repliesSuperseded
- v411 patches 1 replySuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 9 patches | 9 replies | Superseded | |
| v2 | 9 patches | 4 replies | Superseded | |
| v1 | 8 patches | 10 replies | Superseded |
Changes in v6 from the cover letter
- vmlaunchupdate-test should only run for x86_64 and not for i386 as the device
is not supported on i386.
- squashed https://lists.gnu.org/archive/html/qemu-devel/2026-08/msg02839.html into
existing patchset.
- small refactoring of the vmlaunchupdate-test code to put checks for skipping the test earlier.
- CI Passed https://gitlab.com/anisinha/qemu/-/pipelines/2766101668
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | igvm: store IgvmCfg pointer in QIgvmbackends/ include/ | +34 | 0 replies | |
| 2/11 | igvm: track memory regionsbackends/ backends/ include/ | +19 | 0 replies | |
| 3/11 | igvm: cleanup memory regionsbackends/ backends/ include/ | +22 | 0 replies | |
| 4/11 | system/memory: add a tracepoint for memory_region_finalizesystem/ system/ | +2 | 0 replies | |
| 5/11 | backends/igvm: add a tracepoint for qigvm_cleanup_memorybackends/ backends/ | +2 | 0 replies | |
| 6/11 | hw/misc/vmlaunchupdate: add api headerinclude/ | +102 | 2 replies | |
| 7/11 | hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface supporthw/ hw/ hw/ +1 more | +380 | 0 replies | |
| 8/11 | docs/spec: Add a specification document for vm-launch-update devicedocs/ docs/ | +200 | 0 replies | |
| 9/11 | tests/qtest: Add small igvm files for testing purposetests/ tests/ tests/ | +45 | 0 replies | |
| 10/11 | Add functional and unit tests for the vm-launch-update devicetests/ tests/ tests/ +3 more | +716 | 0 replies | |
| 11/11 | Update MAINTAINERSMAINTAINERS | +13 | 0 replies |
Reviews trailers per patch
10 of 11 patches have a Reviewed-by or Acked-by.
| Patch | Ani Sinha | Alexander Graf | Peter Xu | Gerd Hoffmann |
|---|---|---|---|---|
| 1/11 | R-b | R-b | ||
| 2/11 | R-b | R-b | ||
| 3/11 | T-b | R-b | ||
| 4/11 | R-b | |||
| 5/11 | ||||
| 6/11 | R-b | |||
| 7/11 | R-b | R-b | ||
| 8/11 | R-b | |||
| 9/11 | R-b | |||
| 10/11 | R-b | |||
| 11/11 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v6 00/11] Introducing guest driven VM launch update mechanism (BYOF interface)
This is the resurrection of the work that was previously discussed here:
https://lists.endsoftwarepatents.org/archive/html/qemu-devel/2025-03/msg05872.html
This relates to the 'bring your own firmware' work that we are driving at Red Hat, now with IGVM support.
The patchset includes a spec doc that has more details.
This patchset implements the hypervisor interface using fw-cfg. Using this interface, the guest can pass its own IGVM file to the hypervisor. Upon reset, the hypervisor re-initializes the guest using the IGVM file the guest provided. This is useful in order to have deterministic and trustworthy launch measurements, mostly for the cloud confidential guest deployments.
The patchset is also available in this branch https://gitlab.com/anisinha/qemu/-/commits/hyperface-phoenix-v6
This patchset has added functional and unit tests that exercize the hypervisor interface. It has been tested for both confidential guests and non-confidential guests.
Here is the functional test runs for aarch64 and x86_64
$ export QEMU_TEST_QEMU_BINARY=qemu-system-aarch64 $ ./build/run tests/functional/aarch64/test_vm_launch_update_aarch.py TAP version 13 ok 1 test_vm_launch_update_aarch.VmLaunchUpdateDeviceCheck.test_vm_launch_update 1..1
$ export QEMU_TEST_QEMU_BINARY=qemu-system-x86_64 $ ./build/run tests/functional/x86_64/test_vm_launch_update.py TAP version 13 ok 1 test_vm_launch_update.VmLaunchUpdateDeviceCheck.test_vm_launch_update 1..1
For CoCo case, here is the run for the qtest unit test:
$ COCO=1 LAUNCHUPDATE_TRACE=1 LAUNCHUPDATE_DEBUG=1 QTEST_QEMU_BINARY=./qemu-system-x86_64 ./tests/qtest/launchupdate-test
TAP version 14
# random seed: R02S390d06a8e540c421f90f272aee203aa3
1..5
# Start of vm-launch-update tests
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -machine none -accel qtest
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -device vm-launch-update -accel qtest
ok 1 /vm-launch-update/cap
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -device vm-launch-update -accel qtest
ok 2 /vm-launch-update/disabled
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -device vm-launch-update -accel qtest
qemu-system-x86_64: info: guest was not initially started with IGVM, not changing launch state.
ok 3 /vm-launch-update/errorcheck
serial console file is /tmp/launchupdate-qtest-serial-sBHG7T3
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -machine q35,igvm-cfg=igvm0,confidential-guest-support=lsec0 -m 1G -accel kvm -device vm-launch-update --trace memory_region_finalize --trace qigvm_cleanup_memory -D /tmp/qemu-debug.log -chardev file,id=serial0,path=/tmp/launchupdate-qtest-serial-sBHG7T3 -serial chardev:serial0 -object igvm-cfg,id=igvm0,file=tests/data/igvm/snptest-nohello.igvm -object '{"qom-type":"sev-snp-guest","id":"lsec0","cbitpos":51,"reduced-phys-bits":1,"policy":196608}' -accel qtest
target endianness: little
initially booted with host igvm
guest paddr: 100000 igvm size: 195048
writing igvm file into the guest memory
tell hypervisor where igvm is loaded in guest memory
qemu-system-x86_64: info: vmlaunchupdate: new IGVM context set.
resetting the virtual machine now
qemu-system-x86_64: info: virtual machine state has been rebuilt with new guest file handle.
hello world found on console
resetting again in order to restore host provided IGVM
qemu-system-x86_64: info: virtual machine state has been rebuilt with new guest file handle.
qemu-system-x86_64: info: restoring original host IGVM: tests/data/igvm/snptest-nohello.igvm
qemu-system-x86_64: info: vmlaunchupdate: host IGVM context set.
booted with host igvm again
ok 4 /vm-launch-update/load_igvm
# slow test /vm-launch-update/load_igvm executed in 5.01 secs
serial console file is /tmp/launchupdate-qtest-serial-s8YOOU3
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-958552.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-958552.qmp,id=char0 -object monitor-qmp,id=qmp0,chardev=char0 -display none -audio none -run-with exit-with-parent=on -machine q35,igvm-cfg=igvm0,confidential-guest-support=lsec0 -m 1G -accel kvm -device vm-launch-update -chardev file,id=serial0,path=/tmp/launchupdate-qtest-serial-s8YOOU3 -serial chardev:serial0 -object igvm-cfg,id=igvm0,file=tests/data/igvm/snptest-nohello.igvm -object '{"qom-type":"sev-snp-guest","id":"lsec0","cbitpos":51,"reduced-phys-bits":1,"policy":196608}' -accel qtest
initially booted with host igvm
guest paddr: 100000 igvm size: 195048
writing igvm file into the guest memory
tell hypervisor where igvm is loaded in guest memory
qemu-system-x86_64: info: vmlaunchupdate: new IGVM context set.
resetting the virtual machine. This should load user provided igvm.
qemu-system-x86_64: info: virtual machine state has been rebuilt with new guest file handle.
qemu-system-x86_64: info: vmlaunchupdate: next reset will use host igvm
hello world found on console
Now resetting again in order to reset to host igvm
qemu-system-x86_64: info: virtual machine state has been rebuilt with new guest file handle.
qemu-system-x86_64: info: restoring original host IGVM: tests/data/igvm/snptest-nohello.igvm
qemu-system-x86_64: info: vmlaunchupdate: host IGVM context set.
booted with host igvm
ok 5 /vm-launch-update/ctrl_set_once
# slow test /vm-launch-update/ctrl_set_once executed in 4.77 secs
# End of vm-launch-update testsChangelog:
v6:
- vmlaunchupdate-test should only run for x86_64 and not for i386 as the device
is not supported on i386.
- squashed https://lists.gnu.org/archive/html/qemu-devel/2026-08/msg02839.html into
existing patchset.
- small refactoring of the vmlaunchupdate-test code to put checks for skipping the test earlier.
- CI Passed https://gitlab.com/anisinha/qemu/-/pipelines/2766101668
v5:
- add functional tests only if igvm libraries are present as without it, the support for
the device is absent in QEMU.
- add some more checks for the unit test for the required dependencies (device, kvm, q35 etc).
- minor spec doc update.
- rebased,
- tags added.
- QEMU CI passed https://gitlab.com/anisinha/qemu/-/pipelines/2756839922
v4:
- Alex's suggestions addressed.
- Fixed memory region memory leak issue pointed by Alex.
- Updated test/data/igvm/README to mention how to download IGVM bundles for CoCo case.
- Updated qtest to add some tracepoints.
- Added a couple of new patches that add new tracepoints for tracing mr decalocation.
- Tested on CoCo and non-CoCo.
- Rebased and tags added.
v3:
- Gerd's suggestions incorporated.
- Rebased.
- tags added.
v2:
- API definitions moved to a separate userland header file.
- A new ctrl flag is added that will restore original host provided IGVM. Tests for the same are added as well.
- doc updates that describe how the interface works with the new ctrl flag set.
- A memory corruption issue is fixed.
- total size of test IGVM files reduced to 270 KB.
- other review comments addressed.
- tags added.
Ani Sinha (8):
system/memory: add a tracepoint for memory_region_finalize backends/igvm: add a tracepoint for qigvm_cleanup_memory hw/misc/vmlaunchupdate: add api header hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface support docs/spec: Add a specification document for vm-launch-update device tests/qtest: Add small igvm files for testing purpose
Add functional and unit tests for the vm-launch-update device Update MAINTAINERS
Gerd Hoffmann (3):
igvm: store IgvmCfg pointer in QIgvm
igvm: track memory regions
igvm: cleanup memory regions
MAINTAINERS | 13 + backends/igvm-cfg.c | 3 + backends/igvm.c | 97 ++- backends/trace-events | 1 + docs/specs/index.rst | 1 + docs/specs/vmlaunchupdate.rst | 199 ++++++ hw/misc/meson.build | 3 + hw/misc/trace-events | 6 + hw/misc/vmlaunchupdate.c | 333 ++++++++++ include/hw/misc/vmlaunchupdate.h | 38 ++ .../standard-headers/misc/vmlaunchupdate.h | 102 +++ include/system/igvm-internal.h | 8 +- include/system/igvm.h | 1 + system/memory.c | 1 + system/trace-events | 1 + tests/data/igvm/README | 45 ++ tests/data/igvm/hello.igvm | Bin 0 -> 137112 bytes tests/data/igvm/qemuinit.igvm | Bin 0 -> 137112 bytes tests/functional/aarch64/meson.build | 4 + .../aarch64/test_vm_launch_update_aarch.py | 33 + tests/functional/x86_64/meson.build | 4 + .../x86_64/test_vm_launch_update.py | 48 ++ tests/qtest/launchupdate-test.c | 625 ++++++++++++++++++ tests/qtest/meson.build | 2 + 24 files changed, 1535 insertions(+), 33 deletions(-) create mode 100644 docs/specs/vmlaunchupdate.rst create mode 100644 hw/misc/vmlaunchupdate.c create mode 100644 include/hw/misc/vmlaunchupdate.h create mode 100644 include/standard-headers/misc/vmlaunchupdate.h create mode 100644 tests/data/igvm/README create mode 100644 tests/data/igvm/hello.igvm create mode 100644 tests/data/igvm/qemuinit.igvm create mode 100755 tests/functional/aarch64/test_vm_launch_update_aarch.py create mode 100755 tests/functional/x86_64/test_vm_launch_update.py create mode 100644 tests/qtest/launchupdate-test.c
Signature · 1 line
2.42.0