Page MenuHomeFreeBSD

[GSoC 2022] bhyve debug server enhancements
Needs ReviewPublic

Authored by bnovkov on Jul 15 2022, 12:08 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Oct 27, 9:12 PM
Unknown Object (File)
Oct 3 2024, 3:03 PM
Unknown Object (File)
Oct 1 2024, 9:55 PM
Unknown Object (File)
Aug 24 2024, 7:36 PM
Unknown Object (File)
Aug 11 2024, 6:06 PM
Unknown Object (File)
Aug 11 2024, 6:06 PM
Unknown Object (File)
Aug 11 2024, 4:21 PM
Unknown Object (File)
Aug 7 2024, 3:27 AM

Details

Reviewers
jhb
Group Reviewers
bhyve
Summary

This patch implements the required deliverables specified in the GSoC project description.

The changes can be summarized as follows:

  • Support for software breakpoints on AMD SVM,
  • Support for single-stepping AMD SVM guests using the RFLAGS.TF mechanism,
  • Support for placing hardware watchpoints on Intel VMX and AMD SVM guests.

The hardware watchpoint feature dynamically evicts and migrates watchpoints set by the gdb stub when the guest starts using debug registers.
Detailed documentation of all features will be made over the next week.

Test Plan

All changes were tested on an AMD Ryzen 5 5600X and an Intel Core i5-6300U system, both running -CURRENT.

Everything works as expected, but there are a few minor bugs I haven't been able to iron out:

  • Single stepping on AMD hosts lands in the middle of a timer interrupt due to pushf/popf intercepts
  • Intel VMX guests wrongly report a guest watchpoint hit as a trace trap while any gdb stub watchpoints are active

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This is a quite large patch. Could it be split into multiple ones to simplify reviewing and merging?

This is a quite large patch. Could it be split into multiple ones to simplify reviewing and merging?

Thank you for taking the time to look at the patch!
I was postponing the split until I could find a fix for VM single-stepping in general since it interfered with a lot of SVM-related features in this patch.
However, this was solved by D39949 since the same approach can be applied to SVM as well.
I'll update the patch and start chopping it up into smaller pieces, probably starting with breakpoint and single-stepping support for SVM.
Would you be willing to review these smaller patches?

In D35826#910200, @bojan.novkovic_fer.hr wrote:

I'll update the patch and start chopping it up into smaller pieces, probably starting with breakpoint and single-stepping support for SVM.

Thanks!

Would you be willing to review these smaller patches?

Yes. I'm going to review and merge it.