Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Breakpoint state can survive crash or cancellation recovery, and the hidden cache-sync mapping conflicts with the public mapping contract.
4 open findings
What changed in this PR
Adds Windows ARM64 WHP guest debugging and generalizes the GDB implementation across architectures.
Changes:
- Adds ARM64 registers, software breakpoints, stepping, and cache synchronization.
- Extracts shared debugger logic from x86_64 code.
- Updates tests, documentation, and platform configuration.
| File | Description |
|---|---|
CHANGELOG.md |
Records ARM64 GDB support. |
docs/how-to-debug-a-hyperlight-guest.md |
Documents architecture-specific capabilities. |
src/hyperlight_host/build.rs |
Enables GDB on Windows ARM64. |
src/hyperlight_host/examples/guest-debugging/main.rs |
Adds ARM64 debugging tests. |
src/hyperlight_host/src/hypervisor/gdb/arch.rs |
Dispatches architecture-specific logic. |
src/hyperlight_host/src/hypervisor/gdb/arch/aarch64.rs |
Implements ARM64 breakpoint and step decoding. |
src/hyperlight_host/src/hypervisor/gdb/arch/x86_64.rs |
Houses extracted x86_64 logic. |
src/hyperlight_host/src/hypervisor/gdb/event_loop.rs |
Maps ARM64 stop reasons. |
src/hyperlight_host/src/hypervisor/gdb/mod.rs |
Extends shared debugging interfaces. |
src/hyperlight_host/src/hypervisor/gdb/target.rs |
Adds architecture-specific GDB registers. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs |
Connects GDB to ARM64 VMs. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/debug.rs |
Centralizes breakpoint and stepping state. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/mod.rs |
Handles ARM64 debug exits. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs |
Removes extracted debugger logic. |
src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs |
Extends VM exits and errors. |
src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs |
Implements WHP debugging and cache synchronization. |
src/hyperlight_host/src/sandbox/initialized.rs |
Guards snapshots with active breakpoints. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
8c0c245 to
39ea4cb
Compare
This comment has been minimized.
This comment has been minimized.
|
@cshung I guess you are using software breakpoints here because WHPX aarch64 does not yet support setting MDCR_EL2.TDE. I think this is very divergent from the other implementations and especially the emulation of software step looks very fragile in its current state. I wonder if we can make things a little bit more congruent with the other implementations by using the same hardware debug approach as other targets, but on WHP set MDSCR_EL1.KDE and have little assembly stubs catch this case and make hvcs (or, even make an hvc on every exception entry, when in gdb mode)? Admittedly this will not work very well if VBAR_EL1 or virtual memory configuration for the exception handlers are messed up, but in that case I think given the current guest architecture it is extremely unlikely that guest code would continue to execute and produce any useful results. |
7238539 to
6c35092
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
dd86b49 to
698b851
Compare
This comment has been minimized.
This comment has been minimized.
698b851 to
3e3983f
Compare
This comment has been minimized.
This comment has been minimized.
3e3983f to
bed283f
Compare
This comment has been minimized.
This comment has been minimized.
bed283f to
905ca05
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
00b7212 to
d8d79a5
Compare
This comment has been minimized.
This comment has been minimized.
8a9493e to
bd2cc61
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>
Guest debug exceptions reach WHP through HVC. Saved exception context, hardware breakpoints and single-step survive cache synchronization and vCPU reset. The cache-sync trampoline is read-only to guests. Shared debugger behavior belongs to the parent commit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
bd2cc61 to
8cce8f0
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 |



Windows ARM64 WHP GDB
WHP guests support register and memory access, two hardware breakpoints,
four-byte BRK software breakpoints, and hardware single-step.
Guest synchronous exception vectors forward debug stops through HVC.
The backend preserves interrupted context and debugger state across cache
synchronization and vCPU reset.
Commit layers
This PR is B, one WHP-specific commit above shared support A in #2050.
KVM support in #2016 is an independent sibling.
WHP-only comparison.
Shared debugger handling, page-sized memory access and recovery tests belong
to #2050. This layer contains WHP integration, platform enablement, the
read-only cache-sync page and backend tests.
The graph and update rules are in
docs/gdb-commit-layers.md.The full PR diff includes the unmerged shared prerequisite.
Validation
just clippywrecipe passes.just testrecipe, 26 debugger/backend tests and seven real GDB client tests.14 backend/recovery tests on the combined WHP/KVM tree.