All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] vfio/pci: Latch module params, fix bitfield use and VGA unwind
@ 2026-06-11 21:35 Alex Williamson
  2026-06-11 21:35 ` [PATCH v2 1/5] vfio/pci: Latch disable_idle_d3 per device Alex Williamson
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Alex Williamson @ 2026-06-11 21:35 UTC (permalink / raw)
  To: kvm, Alex Williamson
  Cc: Alex Williamson, linux-kernel, Jason Gunthorpe, Kevin Tian, kanie

The vfio-pci module pushes module parameters into vfio-pci-core at
initialization that change global policies for all devices, whether
bound to vfio-pci itself or other variant drivers.  Not only is this
generally bad practice, but in the case of runtime PM, policy changes
can affect initialized devices, even while they're in use, resulting in
unbalanced operations.

This series first addresses the runtime PM case as a separate fix for
stable, latching the runtime PM support into the device.

Then, in preparing for moving disable_vga to per device, it's discovered
that we lack proper unwind support for a registration failure, leaving
the VGA arbiter client registered.  This is resolved before it turns into
an issue, also marked for stable.

Next, we're again reminded of the risky bitfield use in both the
vfio-pci-core and mlx5 variant driver, therefore before expanding use
for more per-device flags, perform the binary split to categorize
flags as either setup/release or runtime to avoid RMW hazards of the
bitfields.  Also for stable.

Finally, close the series by pulling vfio-pci module parameter policy
out of the core, latching each into the device structure.

This latter change also has the effect of restoring the mutability of
two of the module parameters, where that functionality was lost with the
vfio-pci-core split.  With this series, the current parameter values are
latched into the device at probe time.

Please review.  Thanks,
Alex

Alex Williamson (5):
  vfio/pci: Latch disable_idle_d3 per device
  vfio/pci: Release the VGA arbiter client on register_device() failure
  vfio/pci: Fix racy bitfields and tighten struct layout
  vfio/mlx5: Fix racy bitfields and tighten struct layout
  vfio/pci: Latch all module parameters per device

 drivers/vfio/pci/mlx5/cmd.h      | 15 +++++----
 drivers/vfio/pci/vfio_pci.c      | 30 +++++++++++++-----
 drivers/vfio/pci/vfio_pci_core.c | 53 +++++++++++++++-----------------
 include/linux/vfio_pci_core.h    | 18 ++++++-----
 4 files changed, 67 insertions(+), 49 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-06-12 15:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 21:35 [PATCH v2 0/5] vfio/pci: Latch module params, fix bitfield use and VGA unwind Alex Williamson
2026-06-11 21:35 ` [PATCH v2 1/5] vfio/pci: Latch disable_idle_d3 per device Alex Williamson
2026-06-11 21:35 ` [PATCH v2 2/5] vfio/pci: Release the VGA arbiter client on register_device() failure Alex Williamson
2026-06-11 21:53   ` sashiko-bot
2026-06-11 21:35 ` [PATCH v2 3/5] vfio/pci: Fix racy bitfields and tighten struct layout Alex Williamson
2026-06-11 21:35 ` [PATCH v2 4/5] vfio/mlx5: " Alex Williamson
2026-06-11 21:35 ` [PATCH v2 5/5] vfio/pci: Latch all module parameters per device Alex Williamson
2026-06-12  6:25   ` Guixin Liu
2026-06-12 15:05     ` Alex Williamson
2026-06-12  8:40   ` fengchengwen
2026-06-12 14:11     ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.