linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Krowiak <akrowiak@linux.ibm.com>
To: Halil Pasic <pasic@linux.ibm.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	borntraeger@de.ibm.com, cohuck@redhat.com,
	pasic@linux.vnet.ibm.com, jjherne@linux.ibm.com,
	alex.williamson@redhat.com, kwankhede@nvidia.com,
	david@redhat.com, pbonzini@redhat.com,
	David Hildenbrand <david@redhat.com>,
	frankja@linux.ibm.com, imbrenda@linux.ibm.com
Subject: Re: [PATCH 2/2] s390/vfio-ap: replace open coded locks for VFIO_GROUP_NOTIFY_SET_KVM notification
Date: Wed, 28 Jul 2021 09:43:03 -0400	[thread overview]
Message-ID: <a5eeac87-069d-171b-5558-3e99e7bda539@linux.ibm.com> (raw)
In-Reply-To: <20210727004329.3bcc7d4f.pasic@linux.ibm.com>



On 7/26/21 6:43 PM, Halil Pasic wrote:
> On Mon, 26 Jul 2021 19:03:17 -0300
> Jason Gunthorpe <jgg@nvidia.com> wrote:
>
>>> You may end up with open and close running interleaved. What I'
>>> trying to say is, to my best knowledge, normally there is no
>>> you have to close it before you open it again rule for files.
>> This is an existing bug in this driver, I've fixed in the reflck series.
>>
>> open_device/close_device will not run concurrently, or out of order,
>> afer it is fixed.
> Well if that is the case then provided your fix precedes this patch:
>
> Acked-by: Halil Pasic <pasic@linux.ibm.com>
>
> I'm not entirely happy with this. I did not thoroughly investigate the
> implications of reversing the locking order of the vfio-ap lock (driver
> global) and the kvm lock (guest specific). I will trust Tony and hope
> our KVM maintainers will scream if this is bad from interference and
> delay perspective.

This solution was suggested by Jason G and it does in fact resolve
the lockdep splat encountered when starting an SE guest with
access to crypto resources. There is a chance that the KVM lock
can get held while waiting for the lock on the matrix_dev->mutex,
but this does not seem like a grave concern to me. That would
only happen during VFIO_GROUP_NOTIFY_SET_KVM notification - either
when the guest is being started or terminated, or when the mdev
fd is opened or closed. According to Jason, once he integrates his reflck
series, the open/close will happen only once.

I've copied the KVM maintainers on this response, so hopefully one of
them will provide some input.

>
> Regards,
> Halil


  reply	other threads:[~2021-07-28 13:43 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 19:35 [PATCH 0/2] s390/vfio-ap: do not open code locks for VFIO_GROUP_NOTIFY_SET_KVM notification Tony Krowiak
2021-07-19 19:35 ` [PATCH 1/2] s390/vfio-ap: r/w lock for PQAP interception handler function pointer Tony Krowiak
2021-08-18 17:03   ` Christian Borntraeger
2021-08-18 23:25     ` Halil Pasic
2021-08-19  6:56       ` Christian Borntraeger
2021-08-19 13:36       ` Tony Krowiak
2021-08-19 21:42         ` Halil Pasic
2021-08-23 13:08           ` Tony Krowiak
2021-08-19 13:20     ` Tony Krowiak
2021-08-19 17:54       ` Alex Williamson
2021-08-19 17:58         ` Jason Gunthorpe
2021-08-20 15:59           ` Tony Krowiak
2021-08-20 22:05           ` Tony Krowiak
2021-08-20 22:30             ` Jason Gunthorpe
2021-08-23 15:17               ` Tony Krowiak
2021-08-20 22:41             ` Alex Williamson
2021-08-23 20:51               ` Tony Krowiak
2021-07-19 19:35 ` [PATCH 2/2] s390/vfio-ap: replace open coded locks for VFIO_GROUP_NOTIFY_SET_KVM notification Tony Krowiak
2021-07-21 14:45   ` Halil Pasic
2021-07-22 13:09     ` Tony Krowiak
2021-07-23 14:26       ` Halil Pasic
2021-07-23 21:24         ` Tony Krowiak
2021-07-26 20:36           ` Halil Pasic
2021-07-26 22:03             ` Jason Gunthorpe
2021-07-26 22:43               ` Halil Pasic
2021-07-28 13:43                 ` Tony Krowiak [this message]
2021-07-28 19:42                   ` Halil Pasic
2021-07-30 13:33                     ` Tony Krowiak
2021-07-27  6:54               ` Christoph Hellwig
2021-07-21 19:37   ` Jason J. Herne
2021-07-22 13:16     ` Tony Krowiak
2021-08-02 13:10 ` [PATCH 0/2] s390/vfio-ap: do not open code " Tony Krowiak
2021-08-02 13:53   ` Halil Pasic
2021-08-02 16:32     ` Tony Krowiak
2021-08-03 13:08       ` Jason Gunthorpe
2021-08-03 13:34         ` Tony Krowiak
2021-08-18 15:59       ` Christian Borntraeger
2021-08-18 16:39         ` Alex Williamson
2021-08-18 16:50           ` Christian Borntraeger
2021-08-18 22:52             ` Halil Pasic
2021-08-19 15:30           ` Cornelia Huck
2021-08-20 14:24             ` Tony Krowiak

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=a5eeac87-069d-171b-5558-3e99e7bda539@linux.ibm.com \
    --to=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=jgg@nvidia.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.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;
as well as URLs for NNTP newsgroup(s).