Page MenuHomeFreeBSD

bhyve: protect MMIO mapped BDSM register
ClosedPublic

Authored by corvink on May 24 2024, 11:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 18, 10:54 PM
Unknown Object (File)
Sat, Aug 16, 8:46 PM
Unknown Object (File)
Fri, Aug 15, 12:34 AM
Unknown Object (File)
Wed, Aug 13, 8:58 PM
Unknown Object (File)
Tue, Aug 5, 4:02 PM
Unknown Object (File)
Sun, Aug 3, 7:13 PM
Unknown Object (File)
Aug 3 2025, 11:36 AM
Unknown Object (File)
Aug 3 2025, 11:26 AM
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 65041
Build 61924: arc lint + arc unit

Event Timeline

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

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

89

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
141

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.