Page MenuHomeFreeBSD

bhyve: protect MMIO mapped BDSM register
ClosedPublic

Authored by corvink on May 24 2024, 11:35 AM.
Tags
None
Referenced Files
F164486670: D45342.diff
Sat, Aug 1, 8:19 AM
F164440292: D45342.id157703.diff
Sat, Aug 1, 12:38 AM
F164439526: D45342.id.diff
Sat, Aug 1, 12:26 AM
Unknown Object (File)
Thu, Jul 30, 1:12 PM
Unknown Object (File)
Mon, Jul 27, 4:01 PM
Unknown Object (File)
Mon, Jul 27, 9:03 AM
Unknown Object (File)
Sun, Jul 26, 8:11 AM
Unknown Object (File)
Fri, Jul 24, 7:09 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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

91

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
126

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.