Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Resume translation errors can terminate the debugger session, and partially successful code writes can return without synchronizing the guest instruction cache.
2 open issues
What changed in this PR
This PR provides shared ARM64 debugger infrastructure for Hyperlight’s WHP, KVM and MSHV backends. ARM64 platform enablement remains in separate backend PRs.
Changes:
- Adds architecture-specific register handling, breakpoint support and shared debugger request processing.
- Adds guest-page-sized memory access, cache synchronization hooks and snapshot recovery safeguards.
- Adds debugger tests, guest exception forwarding and backend-layer documentation.
| File | Description |
|---|---|
src/hyperlight_host/src/sandbox/uninitialized_evolve.rs |
Initializes ARM64 guest debug vectors. |
src/hyperlight_host/src/sandbox/snapshot/memory/backing.rs |
Exposes backing ranges for cache synchronization. |
src/hyperlight_host/src/sandbox/initialized.rs |
Adds breakpoint guards, recovery handling and tests. |
src/hyperlight_host/src/mem/mgr.rs |
Exposes guest backing host ranges to debugging code. |
src/hyperlight_host/src/mem/exe.rs |
Carries debug-vector addresses in load metadata. |
src/hyperlight_host/src/mem/elf.rs |
Finds and relocates guest debug-vector symbols. |
src/hyperlight_host/src/hypervisor/virtual_machine/whp/x86_64.rs |
Adopts the shared address-translation interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/mshv/x86_64.rs |
Adopts the shared address-translation interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs |
Adds ARM64 debug exit and initialization types. |
src/hyperlight_host/src/hypervisor/virtual_machine/kvm/x86_64.rs |
Adopts the shared address-translation interface. |
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 shared debug state and stop handling. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/debug.rs |
Implements shared requests, breakpoints and ARM64 stepping. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs |
Adds debugger initialization and reset hooks. |
src/hyperlight_host/src/hypervisor/gdb/target.rs |
Supports ARM64 register packets and conversion tests. |
src/hyperlight_host/src/hypervisor/gdb/mod.rs |
Adds page-table translation and cache synchronization hooks. |
src/hyperlight_host/src/hypervisor/gdb/event_loop.rs |
Handles ARM64 initial-stop notifications. |
src/hyperlight_host/src/hypervisor/gdb/arch/x86_64.rs |
Contains x86_64 breakpoint and stop classification logic. |
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 the architecture-specific debugger adapter. |
src/hyperlight_host/examples/guest-debugging/main.rs |
Adds ARM64 GDB client scenarios. |
src/hyperlight_guest_bin/src/arch/aarch64/exception/entry.rs |
Exports debug vectors and forwards synchronous exceptions. |
src/hyperlight_common/src/arch/aarch64/exn.rs |
Defines the debug exception HVC immediate. |
Justfile |
Includes shared debugger and recovery test filters. |
docs/gdb-commit-layers.md |
Documents backend dependencies and validation requirements. |
CHANGELOG.md |
Records debugger memory-access and recovery fixes. |
Review effort: Balanced
a1e7706 to
1790d3c
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. 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>
1790d3c to
7d01a90
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 |

Shared GDB support
Architecture adapters and common debugger handling support ARM64 register
packets, software breakpoints, page-sized memory access, guest debug vectors,
and snapshot, cancellation and crash-detach recovery.
The existing x86_64 platform guard remains. Backend PRs enable ARM64 GDB.
Commit layers
Each layer is one signed commit. B and C are siblings.
E carries A's patch over the independent MSHV prerequisite.
Shared updates propagate to B, C and E/F for validation on all backends.
Branch ownership, update rules and validation requirements are documented in
docs/gdb-commit-layers.md.Validation
and the full
just testrecipe with 1,076 successful test executions.MSHV-only GDB features. All seven real GDB client tests pass.
bootstrap stack preservation, exception-context selection and MMIO stepping.
just clippywpass.KVM-only features.