Page MenuHomeFreeBSD

bhyve: protect MMIO mapped BDSM register
ClosedPublic

Authored by corvink on May 24 2024, 11:35 AM.
Tags
None
Referenced Files
F159761480: D45342.id156886.diff
Wed, Jun 17, 11:02 PM
F159753028: D45342.id139039.diff
Wed, Jun 17, 9:27 PM
Unknown Object (File)
Wed, Jun 17, 12:44 AM
Unknown Object (File)
Tue, Jun 16, 12:37 PM
Unknown Object (File)
Mon, Jun 15, 8:20 AM
Unknown Object (File)
Sat, Jun 13, 11:52 PM
Unknown Object (File)
Thu, Jun 11, 1:39 AM
Unknown Object (File)
Wed, Jun 10, 11:42 PM
Subscribers

Details

Summary

The Windows graphics driver reads the value of the BDSM register from MMIO
space. This value makes no sense in our virtual environment because it's a host
address. Therefore, we have to trap and emulate it.

Diff Detail

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

Event Timeline

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

The indentation of the case labels should be the same as the indentation of switch. .clang-format has IndentCaseLabels: false for this.

88

Is it correct that the offset is the same for both writes?

  • fix style issue
  • use correct offset for 64 bit BDSM read/writes
  • use uint64_t instead of vm_* types
  • account for new handler interface (including baridx)
jhb added inline comments.
usr.sbin/bhyve/amd64/pci_gvt-d.c
47

Maybe add a #define for this magic number to document it a bit more?

This revision is now accepted and ready to land.Jun 30 2025, 6:32 PM
This revision was automatically updated to reflect the committed changes.