Repository navigation
Conversation
cshung
requested review from
andreiltd,
dblnz,
jprendes,
jsturtevant,
ludfjig,
simongdavies,
squillace and
syntactically
as code owners
November 11, 2026 20:15
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical debugging defects can strand the GDB listener, expose or modify the wrong ARM64 register context, and corrupt live bootstrap stack data.
6 open issues
Prevent debug spills from overwriting the bootstrap stack · New Preserve pending exception context until guest ERET · New Validate debug prerequisites before starting the listener · New Reject unbacked GPAs during debugger memory reads · New Handle software-step resume failures as nonfatal · New Stop single-step after delivering an MMIO store · New
What changed in this PR
This PR adds ARM64 Linux/MSHV guest debugging to Hyperlight. Its full scope includes the MSHV backend and shared debugger prerequisites from #1626 and #2050.
Changes:
- Implements MSHV register access, breakpoints, single-step, exception forwarding, and debugger state preservation across VM reset.
- Shares debugger handling across architectures, including page-sized memory access and snapshot recovery.
- Adds native ARM64 MSHV CI, bounded test concurrency, debugger tests, and documentation.
| File | Description |
|---|---|
typos.toml |
Allows an upstream MSHV identifier spelling. |
src/hyperlight_host/tests/sandbox_host_tests.rs |
Bounds ARM64 MSHV test concurrency. |
src/hyperlight_host/tests/integration_test.rs |
Reduces concurrent MSHV partitions in stress tests. |
src/hyperlight_host/src/sandbox/uninitialized_evolve.rs |
Initializes guest debug vectors during setup. |
src/hyperlight_host/src/sandbox/snapshot/memory/backing.rs |
Exposes backing ranges for debugger cache flushing. |
src/hyperlight_host/src/sandbox/snapshot/file/config.rs |
Accepts Arm CPU implementers in Linux tests. |
src/hyperlight_host/src/sandbox/initialized.rs |
Guards snapshots against breakpoints and tests recovery. |
src/hyperlight_host/src/mem/mgr.rs |
Exposes host memory ranges to ARM64 debugging. |
src/hyperlight_host/src/mem/memory_region.rs |
Decodes ARM64 MSHV memory access flags. |
src/hyperlight_host/src/mem/exe.rs |
Carries debug-vector metadata. |
src/hyperlight_host/src/mem/elf.rs |
Locates and relocates guest debug vectors. |
src/hyperlight_host/src/hypervisor/virtual_machine/whp/x86_64.rs |
Adapts the debugger translation interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/mshv/x86_64.rs |
Adapts the debugger translation interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/mshv/aarch64.rs |
Implements the ARM64 MSHV backend and debugger. |
src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs |
Adds ARM64 debug exit and setup error support. |
src/hyperlight_host/src/hypervisor/virtual_machine/kvm/x86_64.rs |
Adapts the debugger translation interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/kvm/aarch64.rs |
Explicitly rejects unsupported KVM debugging. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs |
Uses shared debugger handling and breakpoint storage. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/mod.rs |
Integrates ARM64 debug stops and cancellation handling. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/debug.rs |
Provides shared requests, memory access, and breakpoint handling. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs |
Connects MSHV, debug vectors, and initial stops. |
src/hyperlight_host/src/hypervisor/gdb/target.rs |
Supports ARM64 register packets and target operations. |
src/hyperlight_host/src/hypervisor/gdb/mod.rs |
Adds page-table translation and instruction-cache flushing. |
src/hyperlight_host/src/hypervisor/gdb/event_loop.rs |
Handles ARM64 initial-stop notifications. |
src/hyperlight_host/src/hypervisor/gdb/arch/x86_64.rs |
Isolates x86 breakpoint and stop classification. |
src/hyperlight_host/src/hypervisor/gdb/arch/aarch64.rs |
Defines ARM64 BRK encoding and alignment checks. |
src/hyperlight_host/src/hypervisor/gdb/arch.rs |
Selects architecture-specific debugger helpers. |
src/hyperlight_host/examples/guest-debugging/main.rs |
Adds ARM64 real-client debugger tests. |
src/hyperlight_host/build.rs |
Enables debug-build GDB support for ARM64 Linux/MSHV. |
src/hyperlight_guest_bin/src/arch/aarch64/exception/entry.rs |
Forwards synchronous exceptions through HVC. |
src/hyperlight_common/src/arch/aarch64/exn.rs |
Defines the shared debug HVC immediate. |
Justfile |
Supports nextest selection and broader debugger test filters. |
docs/how-to-debug-a-hyperlight-guest.md |
Documents MSHV debugging and snapshot constraints. |
docs/gdb-commit-layers.md |
Documents shared and backend-specific commit dependencies. |
CHANGELOG.md |
Records backend, debugging, and recovery support. |
.github/workflows/ValidatePullRequest.yml |
Adds ARM64 MSHV debug and release jobs. |
.github/workflows/dep_build_test.yml |
Configures native MSHV runners and debugger validation. |
.config/nextest.toml |
Limits concurrent partition-heavy tests. |
Review effort: Balanced
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
2 times, most recently
from
November 12, 2026 00:12
d38fe01 to
46beba7
Compare
This comment has been minimized.
This comment has been minimized.
MSHV provides partition creation, memory mappings, MMIO dispatch, batched register access and replacement-VM reset on ARM64. Native CI uses tagged hierarchical-virtualization runners and bounded scheduling for the partition limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
Architecture adapters, software breakpoints, page-sized memory access and recovery handling are shared by backend layers. Guest debug vectors and common tests support ARM64. Backend layers control platform enablement. The commit-layer document defines dependencies and shared-update validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
MSHV forwards guest debug exceptions through intercepted HVCs. Register access uses the saved exception context and active stack pointer. Two hardware breakpoints and single-step survive replacement-VM reset. Native ARM64 GDB tests run in debug CI. Non-debug KVM use is available with default features. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 12, 2026 18:15
46beba7 to
19159c6
Compare
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 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


ARM64 Linux MSHV GDB
MSHV guests support register and memory access, two hardware breakpoints,
BRK software breakpoints, and hardware single-step.
Guest exception vectors forward debug stops through HVC.
Debugger register access uses the saved exception context and active stack pointer.
Replacement-VM reset preserves debugger configuration.
The hypercall parser validates message type and payload length.
Native ARM64 MSHV GDB tests run in debug CI.
The default-driver build retains non-debug KVM use and rejects KVM debugging.
KVM debugger support is independent in #2016.
Commit layers
Each layer is one signed commit. A and E have identical zero-context patch IDs.
WHP and KVM debugger support have independent branches.
MSHV GDB-only comparison.
The graph and update rules are in
docs/gdb-commit-layers.md.The full PR diff includes unmerged prerequisites #1626 and #2050.
Validation
Native Azure ARM64 Linux/MSHV validation before this rebase:
just testrecipe passes with 1,076 successful test executions.GDB features.
software and hardware breakpoints, single-step, code writes and snapshots.
listener setup, bootstrap stack corruption, stale exception-context selection
and the extra instruction after an MMIO step.
rebase. Linux and ARM64 cross-Clippy pass on all six layers.
upstream
Sandbox::recreate.just clippyw, and Linux x64 and ARM64 KVM Clippy.Native ARM64 runtime tests were not repeated for this rebase.
The dedicated MSHV validation VM is deallocated.