Page MenuHomeFreeBSD

[GSoC 2022] bhyve debug server enhancements
Needs ReviewPublic

Authored by bojan.novkovic_fer.hr on Jul 15 2022, 12:08 PM.
Tags
Referenced Files
Unknown Object (File)
Oct 28 2023, 12:29 AM
Unknown Object (File)
Oct 28 2023, 12:29 AM
Unknown Object (File)
Oct 27 2023, 7:47 PM
Unknown Object (File)
Oct 11 2023, 8:41 AM
Unknown Object (File)
Oct 11 2023, 8:41 AM
Unknown Object (File)
Oct 10 2023, 5:03 PM
Unknown Object (File)
Sep 28 2023, 2:15 AM
Unknown Object (File)
Sep 13 2023, 8:39 PM

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?

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.