open-standards/sandbox/sandbox-rs/crates/sandbox-exec-microvm/Cargo.toml
Transaction Science 41c58cc769 sandbox-exec-microvm: RAPL-via-MSR meter + real microVM boot example
The S5 executor's PowerMeter had only the powercap RaplMeter, which reads
/sys/class/powercap/intel-rapl:0/energy_uj. But common KVM hosts expose
the RAPL MSR while shipping no powercap node at all — AWS Nitro bare
metal (kernel *-aws) is exactly this: /dev/cpu/N/msr yields a live
MSR_PKG_ENERGY_STATUS (0x611) counter with the unit in
MSR_RAPL_POWER_UNIT (0x606), but /sys/class/powercap is empty.

MsrRaplMeter reads that counter directly (root + msr module), scaling
ticks by 1/2^ESU to microjoules — the same physical energy RaplMeter
reports, on hosts where the sysfs path doesn't exist. Where the MSR is
unreadable, package0() returns None and the executor falls back to the
honest ModelBased vCPU-seconds estimate, unchanged.

The boot_microvm example drives a real Firecracker through the reference
FirecrackerVmm (spawn firecracker --api-sock; PUT boot-source/drives/
machine-config + InstanceStart over our unix-socket HTTP/1.1 client),
meters the boot window on the MSR, and seals a Sandbox S5 JCR-1 receipt
(HwShunt where metered, ModelBased otherwise) — the executor's full
path, end to end, on a Linux KVM host.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-11 13:41:02 -04:00

20 lines
619 B
TOML

[package]
name = "sandbox-exec-microvm"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
description = "Sandbox — an S5 (microVM) executor: a Firecracker driver with pluggable per-device power metering, behind the sandbox-runtime Executor trait."
[dependencies]
sandbox-schema.workspace = true
sandbox-capability.workspace = true
sandbox-meter.workspace = true
sandbox-attest.workspace = true
sandbox-runtime.workspace = true
serde_json.workspace = true
thiserror.workspace = true
[dev-dependencies]
ed25519-dalek.workspace = true