Repository navigation
Speed up full-window MSR restore audit - #1905
Conversation
Probe MSR readability in bounded guest-side batches and recover expected general protection faults without restoring the sandbox after every denied read. Preserve the existing write and restore checks for each readable MSR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
There was a problem hiding this comment.
🟢 Approval recommended
The bounded fault-recovery path preserves the audit’s verification behavior and has focused coverage.
0 open findings
What changed in this PR
Speeds up full-window MSR restore auditing by recovering expected guest faults during batched readability probes.
Changes:
- Adds bounded guest-side MSR probing with recoverable
#GPhandling. - Uses probe bitmaps to audit only readable MSRs.
- Tests allowed and denied KVM reads without sandbox poisoning.
| File | Description |
|---|---|
src/tests/rust_guests/simpleguest/src/main.rs |
Implements batched MSR probing and fault recovery. |
src/hyperlight_host/src/sandbox/initialized.rs |
Integrates probes into the audit and adds KVM coverage. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
This comment has been minimized.
This comment has been minimized.
|
nice! This probably got even worse recentlyd ue to the restore regression on windows! |
Give the transport buffer release test enough heap headroom for guest function metadata and its 32 KiB response allocation. Keep the global sandbox default unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Benchmark ResultsMeasured commit: kvm / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
kvm / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / amd (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
mshv3 / intel (Linux) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / amd (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
hyperv-ws2025 / intel (Windows) (➖ stable)No benchmark improved or regressed. Benchmark Resultsfunction_call_codec
payload_allocation
sandboxes
slot_pool
snapshot_files
virtq_readonly
virtq_readwrite
Reported by |
Summary
The audit probes 147,456 indices. Restoring the complete sandbox after every denied read dominates its runtime on filterless Hyper-V backends.
Performance
On my KVM host, the discovery phase improved from 45.683 seconds to 123.748 milliseconds. This is a 369x speedup. WHP and MSHV CI will provide the representative end-to-end measurements.
Validation
just fmt-applyjust guestsjust clippy