All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Jason Gunthorpe <jgg@nvidia.com>, Tony Krowiak <akrowiak@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	cohuck@redhat.com, pasic@linux.vnet.ibm.com,
	jjherne@linux.ibm.com, alex.williamson@redhat.com,
	kwankhede@nvidia.com, frankja@linux.ibm.com, david@redhat.com,
	imbrenda@linux.ibm.com, hca@linux.ibm.com
Subject: Re: [PATCH 1/3] s390/vfio-ap: clean up mdev resources when remove callback invoked
Date: Tue, 15 Jun 2021 09:43:44 +0200	[thread overview]
Message-ID: <fb6a3aa4-c12b-5b38-54a5-36941d5d8dbd@de.ibm.com> (raw)
In-Reply-To: <20210611164854.GT1002214@nvidia.com>



On 11.06.21 18:48, Jason Gunthorpe wrote:
> On Wed, Jun 09, 2021 at 06:46:32PM -0400, Tony Krowiak wrote:
>> The mdev remove callback for the vfio_ap device driver bails out with
>> -EBUSY if the mdev is in use by a KVM guest (i.e., the KVM pointer in the
>> struct ap_matrix_mdev is not NULL). The intended purpose was
>> to prevent the mdev from being removed while in use. There are two
>> problems with this scenario:
>>
>> 1. Returning a non-zero return code from the remove callback does not
>>     prevent the removal of the mdev.
>>
>> 2. The KVM pointer in the struct ap_matrix_mdev will always be NULL because
>>     the remove callback will not get invoked until the mdev fd is closed.
>>     When the mdev fd is closed, the mdev release callback is invoked and
>>     clears the KVM pointer from the struct ap_matrix_mdev.
>>
>> Let's go ahead and remove the check for KVM in the remove callback and
>> allow the cleanup of mdev resources to proceed.
>>
>> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
>> ---
>>   drivers/s390/crypto/vfio_ap_ops.c | 10 ----------
>>   1 file changed, 10 deletions(-)
> 
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason, I guess you want this patch still in 5.13, the other 2 can be 5.14?

  parent reply	other threads:[~2021-06-15  7:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 22:46 [PATCH 0/3] s390/vfio-ap: refactor mdev remove callback and locks Tony Krowiak
2021-06-09 22:46 ` [PATCH 1/3] s390/vfio-ap: clean up mdev resources when remove callback invoked Tony Krowiak
2021-06-11 16:48   ` Jason Gunthorpe
2021-06-14 17:29     ` Tony Krowiak
2021-06-15  7:43     ` Christian Borntraeger [this message]
2021-06-09 22:46 ` [PATCH 2/3] s390/vfio-ap: introduce two new r/w locks to replace wait_queue_head_t Tony Krowiak
2021-06-11 17:05   ` Jason Gunthorpe
2021-06-11 17:11     ` David Hildenbrand
2021-06-11 17:41       ` Jason Gunthorpe
2021-06-09 22:46 ` [PATCH 3/3] s390/vfio-ap: r/w lock for PQAP interception handler function pointer Tony Krowiak
2021-06-11 17:06   ` Jason Gunthorpe
2021-06-15  8:55   ` Christian Borntraeger
2021-06-15 18:08     ` Tony Krowiak
2021-06-15 18:55     ` 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=fb6a3aa4-c12b-5b38-54a5-36941d5d8dbd@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=hca@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.vnet.ibm.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 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.