Repository navigation
Conversation
cshung
requested review from
andreiltd,
danbugs,
dblnz,
devigned,
jprendes,
jsturtevant,
ludfjig,
simongdavies,
squillace and
syntactically
as code owners
November 3, 2026 00:34
cshung
marked this pull request as draft
November 3, 2026 00:36
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical flaws allow guest modification of executable trampoline code and debugger memory corruption, while breakpoint cleanup and snapshot-ordering issues can leave sandboxes unrecoverable.
5 open issues
Split memory operations at guest page boundaries · New Make the cache-sync trampoline guest read/execute only · New Recheck for breakpoints after snapshot checkpoint interaction · New Clear breakpoint bookkeeping when crash detach cannot restore instructions · New Reconcile breakpoints when restoring a cancelled sandbox · New
What changed in this PR
Adds ARM64 guest debugging on Linux/KVM, alongside the shared debugger infrastructure and Windows/WHP support from #1907.
Changes:
- Supports ARM64 register and memory access, software and hardware breakpoints, and hardware single-step.
- Adds instruction-cache synchronization, debug-state preservation across reset, and snapshot safeguards.
- Adds debugger tests and documents platform capabilities.
| File | Description |
|---|---|
src/hyperlight_host/src/sandbox/uninitialized_evolve.rs |
Initializes ARM64 debug vectors during VM setup. |
src/hyperlight_host/src/sandbox/snapshot/memory/backing.rs |
Exposes backing ranges for cache synchronization. |
src/hyperlight_host/src/sandbox/initialized.rs |
Guards snapshots and restores against active software breakpoints. |
src/hyperlight_host/src/mem/mgr.rs |
Exposes checked host memory ranges to the debugger. |
src/hyperlight_host/src/mem/exe.rs |
Carries debug-vector addresses in load metadata. |
src/hyperlight_host/src/mem/elf.rs |
Finds and relocates the debug-vector symbol. |
src/hyperlight_host/src/hypervisor/virtual_machine/whp/x86_64.rs |
Adapts address translation to the shared interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/whp/aarch64.rs |
Implements WHP debugging, cache synchronization, and tests. |
src/hyperlight_host/src/hypervisor/virtual_machine/mshv/x86_64.rs |
Adapts address translation to the shared interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs |
Adds ARM64 debug exits and initialization errors. |
src/hyperlight_host/src/hypervisor/virtual_machine/kvm/x86_64.rs |
Adapts address translation to the shared interface. |
src/hyperlight_host/src/hypervisor/virtual_machine/kvm/aarch64.rs |
Implements KVM debugging and active-stack-pointer handling. |
src/hyperlight_host/src/hypervisor/regs/aarch64/whp_reg.rs |
Defines WHP debug register identifiers. |
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 stops, stepping, and mapping safeguards. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/debug.rs |
Provides shared requests and software-breakpoint lifecycle handling. |
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs |
Connects ARM64 VM setup and execution to GDB. |
src/hyperlight_host/src/hypervisor/gdb/target.rs |
Adds ARM64 register conversion to the shared target. |
src/hyperlight_host/src/hypervisor/gdb/mod.rs |
Adds page-table translation and cache-flush support. |
src/hyperlight_host/src/hypervisor/gdb/event_loop.rs |
Reports ARM64 initial stops to GDB. |
src/hyperlight_host/src/hypervisor/gdb/arch/x86_64.rs |
Houses x86 breakpoint constants and stop classification. |
src/hyperlight_host/src/hypervisor/gdb/arch/aarch64.rs |
Defines ARM64 software breakpoints 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 breakpoint, stepping, and code-write integration tests. |
src/hyperlight_host/build.rs |
Enables GDB for supported ARM64 platforms. |
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 shared debug-exception HVC immediate. |
docs/how-to-debug-a-hyperlight-guest.md |
Documents ARM64 capabilities and guest-symbol requirements. |
CHANGELOG.md |
Records Linux/KVM and Windows/WHP ARM64 debugging support. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 3, 2026 01:58
a60be9b to
55da94f
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 3, 2026 19:28
55da94f to
2418379
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 4, 2026 16:37
a26c2d9 to
11361ca
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 5, 2026 17:24
11361ca to
4849110
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 11, 2026 20:12
4849110 to
5ddde64
Compare
This was referenced Nov 11, 2026
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 16, 2026 18:16
68a8704 to
45810c6
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 20, 2026 03:14
45810c6 to
bd25b96
Compare
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 23, 2026 17:25
bd25b96 to
4bfc023
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 24, 2026 19:30
4bfc023 to
a44091d
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
3 times, most recently
from
November 25, 2026 17:22
b23e24c to
89968c9
Compare
This comment has been minimized.
This comment has been minimized.
cshung
force-pushed
the
cshung/kvm-aarch64-gdb
branch
from
November 25, 2026 18:40
89968c9 to
a32acde
Compare
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>
ARM64 page-table translation lives with the architecture helpers. Software breakpoint storage stays behind its methods. Debug-exit bindings and cfg placement follow the surrounding style. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
Keep the initial stop in the run loop. Let GDB own software breakpoint step-over and use hardware single-step for step requests. Apply snapshot breakpoint guards to both architectures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
Debugger register and memory edits can violate guest invariants. Reject snapshot creation for the lifetime of debug-configured sandboxes on x86_64 and ARM64, including after detach. Keep loading and restoring existing snapshots available with the existing breakpoint safeguards. 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/kvm-aarch64-gdb
branch
from
November 25, 2026 18:42
a32acde to
339504e
Compare
Match the error directly so the regression test does not require Snapshot to implement Debug. 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/kvm-aarch64-gdb
branch
from
November 25, 2026 19:20
339504e to
977d7da
Compare
The initialized-snapshot regression builds a memory manager inside the ARM64-only test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
KVM debug exits provide hardware breakpoints and single-step. Register access respects the active stack pointer. Native ARM64 GDB tests run in debug CI. 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>
Preserve debug enablement and hardware breakpoints across reset. Keep single-step transient and require explicit unsupported-backend handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: cshung <3410332+cshung@users.noreply.github.com>
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/kvm-aarch64-gdb
branch
from
November 25, 2026 19:46
977d7da to
00436e3
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) (❌ 1.98x)Top regressions
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 KVM GDB
KVM guests support register and memory access, two hardware breakpoints,
BRK software breakpoints, and hardware single-step.
KVM reports debug stops through
KVM_EXIT_DEBUG.Debug state survives vCPU reset, and register access respects the active stack pointer.
Dependencies
Requires shared debugger support in #2050. This PR provides KVM integration,
platform enablement, and native GDB CI. The full diff includes the shared
prerequisite. Default-driver builds retain non-debug MSHV use and reject
MSHV debugging. MSHV debugger support is independent in #2052.
KVM-only comparison.
Validation
November 23, base
f297a914:just testrecipe.Earlier Raspberry Pi 4 validation passed 16 targeted native unit tests and
six real GDB client tests. It uses a separate, uncommitted ARMv8.0 allocator
fix and guests built with
RUSTFLAGS="-C target-feature=-lse".Pi compatibility changes are outside this PR.
Shared support has November 19 native ARM64 MSHV validation through #2052.
Native ARM64 runtime tests have not been repeated on this base. The MSHV
unsupported-debug adapter regression test is cross-compiled only.