Page MenuHomeFreeBSD

bhyve: support VBTs which lay outside of the OpRegion
Needs ReviewPublic

Authored by corvink on May 24 2024, 11:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 5:26 AM
Unknown Object (File)
Sat, Nov 23, 10:02 PM
Unknown Object (File)
Fri, Nov 22, 8:05 PM
Unknown Object (File)
Thu, Nov 21, 1:18 AM
Unknown Object (File)
Wed, Nov 20, 12:51 PM
Unknown Object (File)
Tue, Nov 19, 11:58 AM
Unknown Object (File)
Mon, Nov 11, 8:14 PM
Unknown Object (File)
Thu, Nov 7, 3:56 AM
Subscribers

Details

Reviewers
jhb
markj
Group Reviewers
bhyve
Summary

Previously, all of our devices had an OpRegion with a VBT which lays inside the
OpRegion. Unfortunately, the OpRegion has a fixed size and VBTs get more and
more features/settings. A VBT can be larger than the allocated space of 6 KB
inside the OpRegion. For larger VBTs, Intel added two field to the OpRegion to
report the VBT address and the VBT size. Make bhyve aware of those fields and
put the VBT into the guest memory too.

Unfortunately, Intel forgot to consider virtualization when defining OpRegion
v2.0. OpRegion v2.0 uses an absolute address for pointing to the VBT. This
address is useless in a guest environment. It's possible to patch that.
However, it requires some more work and we can't test it because we have no
test device with this combination. Therefore, we don't want to do that yet
until we have a use case. Fortunately, Intel noticed the issue and from v2.1
onwards, the VBT address is a relative address.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58048
Build 54936: arc lint + arc unit

Event Timeline

usr.sbin/bhyve/amd64/pci_gvt-d.c
199

This mapping doesn't get removed in error paths. Is that intentional?

312
316
331
  • fix style issues
  • unmap vbt->hva in error path
corvink added inline comments.
usr.sbin/bhyve/amd64/pci_gvt-d.c
199

Forgot it. Thanks!