Skip to content

fix: include VMM QEMU options in MR verification#677

Closed
Leechael wants to merge 9 commits into
masterfrom
fix/mr-vmm-qemu-parity
Closed

fix: include VMM QEMU options in MR verification#677
Leechael wants to merge 9 commits into
masterfrom
fix/mr-vmm-qemu-parity

Conversation

@Leechael
Copy link
Copy Markdown
Collaborator

@Leechael Leechael commented May 11, 2026

Summary

This aligns KMS/verifier MR calculation with the QEMU shape used by the VMM.

Changes:

  • Extend dstack_types::VmConfig with qgs_port, SMBIOS product fields, and virtfs_security_model.
  • Have VMM write those fields into .sys-config.json / vm_config.
  • Have verifier pass SMBIOS and 9p security-model fields into dstack-mr.
  • Have dstack-mr include -smbios and configurable 9p security_model in its ACPI-table QEMU invocation.
  • Change VMM 9p virtfs from security_model=mapped to security_model=none.
  • Build both historical ACPI-dump QEMU binaries into KMS/verifier images, using separate builder stages so BuildKit can build them in parallel:
    • passthrough-dump-acpi @ d98440811192c08eafc07c7af110593c6b3758ff as dstack-acpi-tables-8.2.2
    • dstack-qemu-9.2.1 @ dbcec07c0854bf873d346a09e87e4c993ccf2633 as dstack-acpi-tables-9.2.1
  • Select the ACPI-dump QEMU binary by vm_config.qemu_version:
    • < 9.0.0 -> dstack-acpi-tables-8.2.2
    • >= 9.0.0 -> dstack-acpi-tables-9.2.1
  • Use matching QEMU data directories through -L:
    • /usr/local/share/qemu-8.2.2
    • /usr/local/share/qemu-9.2.1
  • Include verifier runtime dependencies for the copied QEMU binaries, including libpixman-1-0.

Context

Runtime VMM hosts can use QEMU 8.2.2 while KMS/verifier had only the 9.2.1-derived dstack-acpi-tables. That makes expected MR calculation depend on the wrong ACPI-dump QEMU for 8.x hosts.

This PR keeps qgs_port = 4050 enabled. Disabling QGS is not a valid fix because it changes the runtime VM behavior.

OS image 0.5.10 updates OVMF to edk2-stable202505; with the newer TDVF/OVMF, the existing mismatch between real VMM QEMU and verifier-side ACPI-dump QEMU can surface as MRTD/RTMR0 mismatch during KMS onboarding.

Verification

  • cargo test -p dstack-mr acpi::tests
  • cargo check -p dstack-mr -p dstack-verifier -p dstack-kms
  • git diff --check
  • docker buildx build --call=targets -f verifier/builder/Dockerfile --build-context build-shared=build/shared verifier
  • docker buildx build --call=targets -f kms/dstack-app/builder/Dockerfile --build-context build-shared=build/shared kms/dstack-app/builder

Note: cargo check -p dstack-vmm on macOS still hits the existing Linux-only nix::fcntl::splice gate in port-forward. Cross-checking dstack-vmm for x86_64-unknown-linux-gnu was blocked locally by missing x86_64-linux-gnu-gcc for ring.

@Leechael Leechael force-pushed the fix/mr-vmm-qemu-parity branch 2 times, most recently from 344c987 to d1c8687 Compare May 11, 2026 22:06
@Leechael Leechael force-pushed the fix/mr-vmm-qemu-parity branch from d1c8687 to fa4126b Compare May 11, 2026 22:11
@Leechael
Copy link
Copy Markdown
Collaborator Author

Closing in favor of #678 which is the actual root-cause fix (OVMF edk2-stable202505 event-log layout). All changes in this PR turned out to be either dead code (SMBIOS / virtfs_security_model / qgs into Machine / legacy SMBIOS fallback don't enter the RTMR0 formula) or regression sources (9p security_model=mapped→none broke pre-existing CVMs). See the diagnose tool extracted into #679.

@Leechael Leechael closed this May 12, 2026
@Leechael Leechael deleted the fix/mr-vmm-qemu-parity branch May 12, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant