Replace QEMU ACPI helper with a pure Rust generator - #1050
Conversation
65953d1 to
9b9a2b1
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the runtime/build-time dependency on a custom QEMU binary for ACPI table extraction by introducing an in-repo, pure-Rust qemu-acpi crate and switching dstack-mr to generate Q35 ACPI/fw_cfg blobs in-process. It also simplifies KMS/Verifier container builds and documentation by deleting the legacy QEMU/ACPI helper stages and pinned-package inputs.
Changes:
- Added
dstack/crates/qemu-acpito generate QEMU-compatible ACPI blobs (with fixtures and golden tests). - Updated
dstack-mrto use the new crate instead of invokingdstack-acpi-tables. - Removed QEMU build stages/pins from Verifier and KMS builder images, plus updated docs and CI docker build checks accordingly.
Reviewed changes
Copilot reviewed 29 out of 51 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| REUSE.toml | Removes obsolete QEMU pinned-package path and annotates new ACPI fixture binaries for REUSE compliance. |
| prek.toml | Drops shellcheck exclusion for deleted config-qemu.sh. |
| dstack/vmm/src/config.rs | Updates config docs to reflect new measurement path wording. |
| dstack/verifier/builder/shared/qemu-pinned-packages.txt | Removes obsolete pinned package list for deleted QEMU/ACPI stage. |
| dstack/verifier/builder/Dockerfile | Deletes the acpi-builder stage and removes QEMU runtime artifacts from the final image. |
| dstack/verifier/builder/build-image.sh | Stops generating/verifying pinned packages for the removed acpi-builder stage. |
| dstack/kms/dstack-app/builder/shared/qemu-pinned-packages.txt | Removes obsolete pinned package list for deleted QEMU/ACPI stage. |
| dstack/kms/dstack-app/builder/README.md | Updates builder README to describe in-binary, pure-Rust ACPI measurement support. |
| dstack/kms/dstack-app/builder/Dockerfile | Removes the QEMU/ACPI build stage and dstack-acpi-tables installation. |
| dstack/kms/dstack-app/builder/build-image.sh | Stops extracting pinned packages for the removed QEMU stage and simplifies build invocation. |
| dstack/gateway/dstack-app/builder/README.md | Removes mention of dstack-acpi-tables from the gateway builder README. |
| dstack/dstack-mr/src/acpi.rs | Replaces subprocess QEMU invocation and ad-hoc parsing with qemu_acpi::build() integration. |
| dstack/dstack-mr/Cargo.toml | Adds qemu-acpi workspace dependency. |
| dstack/crates/qemu-acpi/src/topology.rs | Introduces machine topology model and validation for the generator. |
| dstack/crates/qemu-acpi/src/tables.rs | Implements ACPI blob mutation/generation and golden-vector tests. |
| dstack/crates/qemu-acpi/src/srat.rs | Adds SRAT table construction for NUMA/hugepage layouts. |
| dstack/crates/qemu-acpi/src/profile.rs | Adds QEMU version parsing and compatibility-family mapping. |
| dstack/crates/qemu-acpi/src/lib.rs | Exposes the public API (build, config types, error types) for ACPI blob generation. |
| dstack/crates/qemu-acpi/src/fw_cfg.rs | Generates fw_cfg loader/rsdp blobs and applies checksums/pointers. |
| dstack/crates/qemu-acpi/src/cpu.rs | Generates AML CPU objects and notify-case snippets for CPU hotplug support. |
| dstack/crates/qemu-acpi/src/aml_patch.rs | Provides AML package-length encoding/adjustment helpers used during mutation. |
| dstack/crates/qemu-acpi/fixtures/README.md | Documents provenance and regeneration rules for binary fixtures. |
| dstack/crates/qemu-acpi/examples/dump.rs | Adds an example program to generate and dump tables for debugging. |
| dstack/crates/qemu-acpi/Cargo.toml | Defines the new crate and its dependencies. |
| dstack/Cargo.toml | Adds qemu-acpi to the workspace members and workspace dependencies. |
| dstack/Cargo.lock | Records the new crate and dependency graph changes. |
| dstack/build/shared/config-qemu.sh | Removes obsolete QEMU build configuration script. |
| docs/tutorials/kms-build-configuration.md | Removes instructions and dependencies for copying/building dstack-acpi-tables into images. |
| docs/tutorials/attestation-verification.md | Replaces QEMU helper build instructions with in-process ACPI generation note. |
| .github/workflows/docker-build-check.yml | Removes CI steps for building/verifying the deleted acpi-builder stages and pins. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
9b9a2b1 to
34d06af
Compare
|
Security hardening update: all production |
d6255a2 to
46225a9
Compare
46225a9 to
e5af262
Compare
|
Addressed the independent differential review in
The production-fork differential script also passed 10 compatibility versions × normal/NUMA/NUMA-PXB, with |
Summary
qemu-acpicrate that reproduces Q35 ACPI/fw_cfg blobs for dstack's supported QEMU compatibility profilesdstack-acpi-tablessubprocess indstack-mrwith in-process generationCompatibility validation
The complete measured blob set (
etc/acpi/tables,etc/table-loader, andetc/acpi/rsdp) was compared byte for byte against the pinned production compatibility reference across:The fixture provenance is pinned to
kvinwang/qemu-tdx@9de6fdfff3a84103b83ca6b2e8c4fb8e05cf9195. Test-only instrumentation patches and reproducible differential scripts are included incrates/qemu-acpi/scripts.The compatibility implementation was also cross-validated against genuine upstream releases rather than only the dstack fork:
3e0bcba1ca7d6607ca49a988d165f052a3a53323)aeec49e8170de7846f476124602cf7acd400c3df)For both releases, normal, NUMA, and NUMA/PXB outputs matched all three blobs byte for byte. No genuine upstream 11.1 release exists at the time of this audit, so 11.1 remains explicitly documented as a production-fork compatibility profile.
Golden fixtures now cover
tables + loader + rsdpfor both ordinary and NUMA configurations. Loader construction is table-driven and includes optional SRAT checksum and all RSDT pointer commands in QEMU's exact build order.Security
unwraporexpectclippy::unwrap_usedandclippy::expect_usedgates passTests
cargo test -p qemu-acpicargo test -p dstack-mr -p dstack-mr-clicargo clippy -- -D warnings -D clippy::expect_used -D clippy::unwrap_used --allow unused_variablescargo fmt --all -- --checkshellcheck crates/qemu-acpi/scripts/*.shreuse lintprek run --from-ref origin/next --to-ref HEAD --show-diff-on-failureLocal Docker execution was attempted, but this runner's mandatory
sudo su kvin -c "docker ..."path is unavailable because the environment hasno_new_privilegesand a non-root-owned/etc/sudo.conf. The Docker build checks in CI provide the authoritative container validation.