The nointxmask and disable_idle_d3 module parameters are registered with S_IWUSR, exposing a writable node under /sys/module/vfio_pci/parameters/. However, writing to them at runtime has no effect on driver behaviour: - Both values are copied into vfio-pci-core's own static variables via vfio_pci_core_set_params(), which is only called once at module init time. A later write to the vfio_pci front-end variable is never propagated to the core. - disable_idle_d3 additionally gates paired runtime PM get/put calls across the probe/remove (register/unregister) and open/close (enable/disable) life cycles. Changing it at runtime would tear these pairs apart and leak or underflow the runtime PM usage counter. - nointxmask is latched into per-device state (vdev->nointx / vdev->pci_2_3) at device open time, so a later change can only affect newly opened devices and yields inconsistent behaviour. These parameters are effectively load-time constants. Drop the write permission so they match disable_vga, which is already read-only, and to stop misleading users into thinking they are runtime tunable. Signed-off-by: Guixin Liu --- drivers/vfio/pci/vfio_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 0c771064c0b8..b72f168feb3c 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -35,7 +35,7 @@ module_param_string(ids, ids, sizeof(ids), 0); MODULE_PARM_DESC(ids, "Initial PCI IDs to add to the vfio driver, format is \"vendor:device[:subvendor[:subdevice[:class[:class_mask]]]]\" and multiple comma separated entries can be specified"); static bool nointxmask; -module_param_named(nointxmask, nointxmask, bool, S_IRUGO | S_IWUSR); +module_param_named(nointxmask, nointxmask, bool, 0444); MODULE_PARM_DESC(nointxmask, "Disable support for PCI 2.3 style INTx masking. If this resolves problems for specific devices, report lspci -vvvxxx to linux-pci@vger.kernel.org so the device can be fixed automatically via the broken_intx_masking flag."); @@ -46,7 +46,7 @@ MODULE_PARM_DESC(disable_vga, "Disable VGA resource access through vfio-pci"); #endif static bool disable_idle_d3; -module_param(disable_idle_d3, bool, S_IRUGO | S_IWUSR); +module_param(disable_idle_d3, bool, 0444); MODULE_PARM_DESC(disable_idle_d3, "Disable using the PCI D3 low power state for idle, unused devices"); -- 2.43.7