Skip to content

Gdb debug improvements #456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025
Merged

Conversation

dblnz
Copy link
Contributor

@dblnz dblnz commented May 2, 2025

Purpose

I opened up this PR to address some leftover comments from a previous PR.
This closes #380 .

Description

These changes do the following

  • move the x86 vCPU specific constants to gdb/arch.rs to avoid duplicating them
  • add a function that determines the vCPU stop reason based on a series of parameters (DR6 register, exception vector)
  • modify kvm get_stop_reason method to use the hypervisor independent function described above
  • retrieve additional information from the mshv hv_message returned after a run call.
    This information serves the get_stop_reason with information on the exception that was triggered.
  • modify the mshv debugging code to use the hypervisor independent function which determines the stop reason of an x86 vCPU.

Note: I tested the scenario specified in this comment and it does not present any issue

@dblnz dblnz added the kind/refactor For PRs that restructure or remove code without adding new functionality. label May 2, 2025
@dblnz dblnz self-assigned this May 2, 2025
@dblnz dblnz changed the title Gdb debug improvements #380 Gdb debug improvements May 2, 2025
@dblnz dblnz changed the title #380 Gdb debug improvements Gdb debug improvements May 2, 2025
@dblnz dblnz marked this pull request as ready for review May 2, 2025 10:42
@dblnz dblnz requested a review from syntactically May 2, 2025 10:42
dblnz added 3 commits May 7, 2025 14:30
- this helps contain the x86 specific registers, masks isolated from
the higher level logic

Signed-off-by: Doru Blânzeanu <[email protected]>
- update kvm_debug to use this hypervisor independent function

Signed-off-by: Doru Blânzeanu <[email protected]>
@dblnz dblnz force-pushed the gdb-debug-improvements branch from 82c95f2 to f99e17c Compare May 7, 2025 11:30
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@dblnz dblnz merged commit cfc394c into hyperlight-dev:main May 9, 2025
33 of 49 checks passed
@dblnz dblnz deleted the gdb-debug-improvements branch May 9, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor For PRs that restructure or remove code without adding new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the way vCPU stop reason is implemented to reduce code duplication
3 participants