From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Jason Gunthorpe <jgg@nvidia.com>,
Anthony Krowiak <akrowiak@linux.ibm.com>
Cc: Yi Liu <yi.l.liu@intel.com>,
alex.williamson@redhat.com, pbonzini@redhat.com,
kevin.tian@intel.com, cohuck@redhat.com, farman@linux.ibm.com,
pmorel@linux.ibm.com, borntraeger@linux.ibm.com,
frankja@linux.ibm.com, imbrenda@linux.ibm.com, david@redhat.com,
jjherne@linux.ibm.com, pasic@linux.ibm.com,
zhenyuw@linux.intel.com, zhi.a.wang@intel.com, seanjc@google.com,
linux-s390@vger.kernel.org, kvm@vger.kernel.org,
intel-gvt-dev@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm/vfio: Fix potential deadlock on vfio group_lock
Date: Tue, 31 Jan 2023 10:00:14 -0500 [thread overview]
Message-ID: <03ff0663-da37-8907-53ec-15234fd7dcad@linux.ibm.com> (raw)
In-Reply-To: <Y9kqNnJ5ayCQSW9z@nvidia.com>
On 1/31/23 9:48 AM, Jason Gunthorpe wrote:
> On Tue, Jan 31, 2023 at 09:46:18AM -0500, Anthony Krowiak wrote:
>
>>> Maybe you should split that lock and have a dedicated apcb lock?
>>
>> I don't think that would suffice for taking the vCPUs out of SIE.
>
> Then I think we have to keep this patch and also do Matthew's patch to
> keep kvm refs inside vfio as well.
>
I don't think keeping kvm refs inside vfio solves this issue though -- Even if we handle the kvm_put_kvm asynchronously within vfio as previously proposed, kvm_vfio_release will eventually get called and it gets called with the kvm->lock already held, then proceeds to call vfio_file_set_kvm which gets the group->lock. That order conflicts with the hierarchy used by the driver during open_device of vfio->group_lock ... kvm->lock.
next prev parent reply other threads:[~2023-01-31 15:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-20 15:05 [PATCH] kvm/vfio: Fix potential deadlock on vfio group_lock Yi Liu
2023-01-20 15:08 ` Liu, Yi L
2023-01-20 15:45 ` Matthew Rosato
2023-01-20 15:49 ` Alex Williamson
2023-01-20 17:58 ` Alex Williamson
2023-01-31 14:27 ` Anthony Krowiak
2023-01-31 14:34 ` Jason Gunthorpe
2023-01-31 14:46 ` Anthony Krowiak
2023-01-31 14:48 ` Jason Gunthorpe
2023-01-31 15:00 ` Matthew Rosato [this message]
2023-01-31 15:12 ` Jason Gunthorpe
2023-01-31 14:35 ` Matthew Rosato
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=03ff0663-da37-8907-53ec-15234fd7dcad@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jgg@nvidia.com \
--cc=jjherne@linux.ibm.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pmorel@linux.ibm.com \
--cc=seanjc@google.com \
--cc=yi.l.liu@intel.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.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