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)
Fri, Oct 18, 7:08 PM
Unknown Object (File)
Fri, Oct 18, 12:33 AM
Unknown Object (File)
Wed, Oct 16, 4:50 AM
Unknown Object (File)
Tue, Oct 15, 2:21 AM
Unknown Object (File)
Sun, Oct 13, 9:19 AM
Unknown Object (File)
Sun, Oct 13, 6:27 AM
Unknown Object (File)
Fri, Oct 11, 2:14 PM
Unknown Object (File)
Tue, Oct 8, 4:18 PM
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!