From: Jason Gunthorpe <jgg@nvidia.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Tony Krowiak <akrowiak@linux.ibm.com>,
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,
Vasily Gorbik <gor@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/2] s390/vfio-ap: clean up mdev resources when remove callback invoked
Date: Mon, 21 Jun 2021 14:27:14 -0300 [thread overview]
Message-ID: <20210621172714.GS1002214@nvidia.com> (raw)
In-Reply-To: <e809be5b-0b24-34dc-1eae-82b58dc54545@de.ibm.com>
On Mon, Jun 21, 2021 at 06:04:54PM +0200, Christian Borntraeger wrote:
>
>
> On 21.06.21 17:57, 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>
> > Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> > Cc: stable@vger.kernel.org
>
> This one is already queued on
>
> https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git/log/?h=fixes
>
> Jason. Do you want this in stable? Then we should write a mail after
> merging.
It is fine as is, we are already at rc7, so long as it goes to some
tree for this merge window
Jason
next prev parent reply other threads:[~2021-06-21 17:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 15:57 [PATCH v6 0/2] s390/vfio-ap: fix memory leak in mdev remove callback Tony Krowiak
2021-06-21 15:57 ` [PATCH v6 1/2] s390/vfio-ap: clean up mdev resources when remove callback invoked Tony Krowiak
2021-06-21 16:04 ` Christian Borntraeger
2021-06-21 17:27 ` Jason Gunthorpe [this message]
2021-06-21 15:57 ` [PATCH v6 2/2] s390/vfio-ap: r/w lock for PQAP interception handler function pointer Tony Krowiak
2021-06-30 15:18 ` Tony Krowiak
2021-07-01 15:25 ` Christian Borntraeger
2021-07-01 16:28 ` Tony Krowiak
2021-07-07 17:16 ` Tony Krowiak
2021-07-01 15:13 ` 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=20210621172714.GS1002214@nvidia.com \
--to=jgg@nvidia.com \
--cc=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=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.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.