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)
Mon, Apr 22, 8:04 AM
Unknown Object (File)
Fri, Apr 19, 2:37 AM
Unknown Object (File)
Fri, Mar 29, 11:01 PM
Unknown Object (File)
Mar 7 2024, 1:45 AM
Unknown Object (File)
Feb 19 2024, 6:39 AM
Unknown Object (File)
Jan 22 2024, 5:29 PM
Unknown Object (File)
Jan 17 2024, 7:22 AM
Unknown Object (File)
Jan 10 2024, 8:44 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.