Page MenuHomeFreeBSD

bhyve: emulate reads of MSI-X capabilities for passthru devices
ClosedPublic

Authored by c.koehne_beckhoff.com on Oct 27 2021, 7:34 AM.

Details

Summary

Reads of the MSI-X capabilites aren't emulated by passthru devices
yet. The guest will read the host MSI-X capabilites which could
cause issues.

Note: You may wanna have a look at https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/msix-read

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

LGMT.
Will commit next monday unless someone have more comments until then.

This revision is now accepted and ready to land.Nov 18 2021, 3:29 PM
markj added a subscriber: markj.

For my own edification, what problem arises when we go straight to the device? Since writes to the msi-x cap are emulated, I guess a guest might observe that a previous write didn't update some field in the capability, but I'm curious about the details.

usr.sbin/bhyve/pci_passthru.c
736

Long line.

For my own edification, what problem arises when we go straight to the device? Since writes to the msi-x cap are emulated, I guess a guest might observe that a previous write didn't update some field in the capability, but I'm curious about the details.

In the worst case, the guest notices that something goes wrong and stops using the device. I've noticed this mistake while investigating some PCI passthrough issues. It wasn't the root cause of my issues. So, I'm unsure whether there are some real faults caused by the missing emulation of MSI-X reads or not. However, we should correct this mistake.

This revision now requires review to proceed.Nov 22 2021, 10:43 AM
This revision is now accepted and ready to land.Nov 22 2021, 1:56 PM