Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@nvidia.com>
To: alex@shazbot.org
Cc: Alex Williamson <alex.williamson@nvidia.com>,
	kvm@vger.kernel.org, jgg@ziepe.ca, rananta@google.com,
	yishaih@nvidia.com
Subject: [PATCH 0/2] vfio: Fix racy bitfields and tighten struct layout
Date: Thu,  7 May 2026 13:22:00 -0600	[thread overview]
Message-ID: <20260507192206.1350046-1-alex.williamson@nvidia.com> (raw)

This follows Raghavendra's "vfio/pci: Use a private flag to prevent
power state change with VFs"[1] and addresses a portion of the
Sashiko review[2].  The review flagged that the new sriov_pwr_active:1
bitfield shares storage with concurrently-updated neighbors so a
bitfield RMW could clobber an adjacent field's update.
                                                            
Auditing bitfield users in vfio_pci_core_device finds several
pre-existing fields with the same hazard, and an analogous pattern in
mlx5_vhca_page_tracker / mlx5vf_pci_core_device.  This series splits
all such fields out of their shared storage words, resolving both the
existing and proposed cases.  Applies on top of [1].

Thanks,
Alex

[1] https://lore.kernel.org/all/20260504224142.1041477-1-rananta@google.com/
[2] https://sashiko.dev/#/patchset/20260504224142.1041477-1-rananta@google.com

Alex Williamson (2):
  vfio/pci: Fix racy bitfields and tighten struct layout
  vfio/mlx5: Fix racy bitfields and tighten struct layout

 drivers/vfio/pci/mlx5/cmd.h   |  8 ++++----
 include/linux/vfio_pci_core.h | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

-- 
2.51.0


             reply	other threads:[~2026-05-07 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 19:22 Alex Williamson [this message]
2026-05-07 19:22 ` [PATCH 1/2] vfio/pci: Fix racy bitfields and tighten struct layout Alex Williamson
2026-05-07 19:22 ` [PATCH 2/2] vfio/mlx5: " Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260507192206.1350046-1-alex.williamson@nvidia.com \
    --to=alex.williamson@nvidia.com \
    --cc=alex@shazbot.org \
    --cc=jgg@ziepe.ca \
    --cc=kvm@vger.kernel.org \
    --cc=rananta@google.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox