]> git.ipfire.org Git - thirdparty/linux.git/commit
vfio/pci: Latch all module parameters per device
authorAlex Williamson <alex.williamson@nvidia.com>
Mon, 15 Jun 2026 19:12:33 +0000 (13:12 -0600)
committerAlex Williamson <alex@shazbot.org>
Mon, 29 Jun 2026 19:46:50 +0000 (13:46 -0600)
commit3788cd493e444742bc2ba252eb5c09ffc8b345dc
tree0b0187c00a32dadd2f54a42df737ed54643bfe6f
parentf2365a63b02ddea32e7db78b742c2503ec7b81f1
vfio/pci: Latch all module parameters per device

The vfio-pci module parameters of disable_idle_d3, nointxmask, and
disable_vga latch vfio-pci policy into vfio-pci-core globals each time
the vfio-pci module is initialized.  The disable_idle_d3 parameter has
already migrated to a per-device flag in order to provide consistency
for refcounted PM operations for the lifetime of the device
registration.

Pull the remaining vfio-pci module-parameter policy out of vfio-pci-core
into per-device flags set at device initialization.

This also restores the mutable aspect of the disable_idle_d3 and
nointxmask module parameters for vfio-pci, with the caveat that the
parameters are latched into the device at probe.

A notable change for variant drivers is that their devices are no longer
affected by vfio-pci module parameters and those drivers may need to
adopt similar module parameters if any devices have a hidden dependency
on vfio-pci setting non-default policy.

Assisted-by: Claude:claude-opus-4-8
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20260615191241.688297-6-alex.williamson@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/vfio_pci.c
drivers/vfio/pci/vfio_pci_core.c
include/linux/vfio_pci_core.h