mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Alex Williamson <alex@shazbot.org>
Cc: kvm@vger.kernel.org, kevin.tian@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vfio/pci: Use RCU for error/request triggers to avoid circular locking
Date: Wed, 26 Nov 2025 15:54:12 -0400	[thread overview]
Message-ID: <20251126195412.GB738503@ziepe.ca> (raw)
In-Reply-To: <20251124223623.2770706-1-alex@shazbot.org>

On Mon, Nov 24, 2025 at 03:36:22PM -0700, Alex Williamson wrote:
> From: Alex Williamson <alex.williamson@nvidia.com>
> 
> Thanks to a device generating an ACS violation during bus reset,
> lockdep reported the following circular locking issue:
> 
> CPU0: SET_IRQS (MSI/X): holds igate, acquires memory_lock
> CPU1: HOT_RESET: holds memory_lock, acquires pci_bus_sem
> CPU2: AER: holds pci_bus_sem, acquires igate
> 
> This results in a potential 3-way deadlock.
> 
> Remove the pci_bus_sem->igate leg of the triangle by using RCU
> to peek at the eventfd rather than locking it with igate.
> 
> Fixes: 3be3a074cf5b ("vfio-pci: Don't use device_lock around AER interrupt setup")
> Signed-off-by: Alex Williamson <alex.williamson@nvidia.com>
> ---
>  drivers/vfio/pci/vfio_pci_core.c  | 68 ++++++++++++++++++++++---------
>  drivers/vfio/pci/vfio_pci_intrs.c | 52 ++++++++++++++---------
>  drivers/vfio/pci/vfio_pci_priv.h  |  4 ++
>  include/linux/vfio_pci_core.h     | 10 ++++-
>  4 files changed, 93 insertions(+), 41 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

  reply	other threads:[~2025-11-26 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 22:36 Alex Williamson
2025-11-26 19:54 ` Jason Gunthorpe [this message]
2025-11-28 19:44 ` 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=20251126195412.GB738503@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alex@shazbot.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®