Page MenuHomeFreeBSD

bhyve: Keep passthrough PCI power state virtual
ClosedPublic

Authored by kbowling on Aug 17 2026, 5:42 PM.
Tags
None
Referenced Files
F174596604: D58892.diff
Sun, Oct 4, 1:23 PM
Unknown Object (File)
Tue, Sep 29, 4:25 PM
Unknown Object (File)
Fri, Sep 25, 9:44 PM
Unknown Object (File)
Thu, Sep 24, 12:58 AM
Unknown Object (File)
Mon, Sep 14, 7:08 AM
Unknown Object (File)
Mon, Sep 14, 1:58 AM
Unknown Object (File)
Mon, Sep 14, 1:53 AM
Unknown Object (File)
Mon, Sep 14, 1:53 AM
Subscribers

Details

Reviewers
markj
jhb
Group Reviewers
bhyve
Summary
The passthrough Command register is emulated, but PMCSR writes were
sent directly to the physical function.  A guest D3hot-to-D0 transition
can perform an internal reset and clear physical Command while its
emulated copy remains enabled.

Cache the Power Management capability and keep the physical D-state
host-owned.  Emulate the guest D-state and advertise No_Soft_Reset so
the guest is not promised a function reset by a virtual power cycle.
Restore the assignment-time virtual state after a managed FLR.

MFC after:      2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

usr.sbin/bhyve/pci_passthru.c
1326–1327

Is this an unrelated cleanup?

1351

It'd be good to introduce a helper function which factors out this expression, with a comment explaining it, as it appears quite a few times and isn't easy to read.

usr.sbin/bhyve/pci_passthru.c
1326–1327

it's related to the immediate predecessor, this 0xffff check was for device removal.

This revision is now accepted and ready to land.Aug 20 2026, 1:41 PM