mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
msix vector table is stored in mmio, its contents is saved and restored by pci bus dirver during device PM. With vfio-pci device, msix is virtualized and guest pci bus driver could maintain virtualized msix vector table. But vfio-pci device maybe poweroff and the physical msix vector table will be lost, crosvm couldn't maintain physical msix vector table during vfio-pci device suspend and resume. kernel vfio-pci set msix message for each enabled vector which is specified in VFIO_DEVICE_SET_IRQS() ioctl, this commit use this to restore physical msix vector table during vfio-pci device's resume. __pci_restore_msix_state() is called during device resume, this function set enable and maskall bit first, then restore msix vetor table, finally set enable bit and clear maskall bit. so when enable and maskall bit is set, virtualized msix could be disabled. When enable is set and maskall is cleared, vituallized msix will be enabled through VFIO_DEVICE_SET_IRQS() ioctl, and kernel restores vfio-pci device's physical msix table. BUG=b:185084350 TEST=verify vfio-pci device's suspend and resume function in vm, this device should have msix capability like TBT controller. Change-Id: I0a9e91874a9d1ec4b0bb9ff655b83a293daa6865 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3291758 Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
src | ||
.build_test_serial | ||
Cargo.toml |