lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] s390/vfio-ap: clean up mdev resources when remove callback invoked
    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

    \
     
     \ /
      Last update: 2021-06-11 18:49    [W:4.958 / U:0.204 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site