The VID, DID, REVID, SUBVID and SUBDID of igd-lpc need aligned with physical one. Without these physical values, GVT-d GOP driver couldn't work.
Please limit capabilities on the descriptor, see the use of caph_rights_limit() and caph_ioctls_limit() in passthru_init(). Actually I do not see why the descriptor needs to be kept open indefinitely.
In general I'd like some way to not force this on always perhaps? Or at least provide a configuration knob to allow it to be turned off in case it breaks other systems that don't need GVT-d.
Ideally I think what I would like is for the lpc device to honor config values to set these registers and have a hook here that sets the config variables if they aren't always set (so the user can always override them if needed).
- reuse read_config of pci_passthru
- allow users to overwrite LPC ids
I've split my patch into multiple commits at https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/lpc-id. It may be easier to review these small commits than the whole patch.
Btw: I can also create a pull request at https://github.com/Beckhoff/freebsd-src and we can talk in that pull request about the commits if you like to.
New sentences should start on new lines.
Should we also check the device class and subclass?
Please add a comment explaining why we look at the host device.
Why does it need to be exported? Should this be rebased on D33769?
On physical systems, it's unnecessary. However, it might change in future and it could be different in nested VM situations. So yeah, it makes sense to check device class and subclass too.
/* * The VID, DID, REVID, SUBVID and SUBDID of lpc need to be * aligned with the physical ones. Without these physical * values, GPU passthrough of Intel integrated graphics devices * won't work properly. The Intel GOP driver checks these values * to proof that it runs on the correct platform. */
It's already there.
I've cherry picked that part from another patch, which requires it to be exported too. Yes, it should be rebase on D33769.