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.
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 12, 2026 18:15
46beba7 to
19159c6
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 16, 2026 18:16
19159c6 to
e1fef27
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 20, 2026 00:08
e1fef27 to
ced5079
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 20, 2026 03:14
ced5079 to
ab1ec3d
Compare
This was referenced Nov 20, 2026
This comment has been minimized.
This comment has been minimized.
cshung
added a commit
that referenced
this pull request
Nov 23, 2026
## ARM64 Linux MSHV The backend provides partition creation, memory mappings, MMIO dispatch, batched register access, and replacement-VM reset. MMIO PC advancement wraps at the address boundary. GIC addresses use the shared layout constants. Native ARM64 MSHV CI uses hierarchical-virtualization runners and bounded test scheduling for the platform's partition budget. Test concurrency follows the selected hypervisor at runtime. Stress tests retain their iteration counts. Partition reuse is tracked in #2080. Guest debugging is in #2052. ## Validation November 19, source `c51ec90f`, base `5fe5c8f8`: * Windows x64 formatting, `just clippy`, `just build`, and the full `just test` recipe pass. * ARM64 Linux cross-Clippy passes with default, MSHV-only, and KVM-only features. * Native ARM64 Linux/MSHV passes all four backend tests with default and MSHV-only features, including GPR and FPU round trips. * With this backend, #2052 passes native formatting, Clippy, fresh debug/release Rust and C guest builds, 481 library tests (13 ignored), five concurrency tests, and seven real GDB client tests. Signed-off-by: cshung <3410332+cshung@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cshung
force-pushed
the
cshung/mshv-aarch64-gdb
branch
from
November 23, 2026 17:25
ab1ec3d to
bc44203
Compare
This comment has been minimized.
This comment has been minimized.
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. 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 24, 2026 19:30
bc44203 to
6fe29f5
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.
Dependencies
Requires shared debugger support in #2050. The MSHV backend is part of
mainthrough #1626. The full diff includes the shared prerequisite.MSHV GDB-only comparison.
Validation
November 23, base
f297a914:just testrecipe.November 19 native Azure ARM64 Linux/MSHV validation, base
5fe5c8f8:Native ARM64 runtime tests have not been repeated on this base.