lkml.org 
[lkml]   [2021]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] s390/vfio-ap: do not use open locks during VFIO_GROUP_NOTIFY_SET_KVM notification
From
Date


On 6/28/21 1:34 PM, Jason Gunthorpe wrote:
> On Fri, Jun 25, 2021 at 06:07:58PM -0400, Tony Krowiak wrote:
>> static void vfio_ap_mdev_unset_kvm(struct ap_matrix_mdev *matrix_mdev)
>> {
>> + mutex_lock(&matrix_dev->lock);
>>
>> + if ((matrix_mdev->kvm) && (matrix_mdev->kvm->arch.crypto.crycbd)) {
>> mutex_unlock(&matrix_dev->lock);
>> + down_write(&matrix_mdev->kvm->arch.crypto.pqap_hook_rwsem);
>> + matrix_mdev->kvm->arch.crypto.pqap_hook = NULL;
>> + up_write(&matrix_mdev->kvm->arch.crypto.pqap_hook_rwsem);
>>
>> + kvm_arch_crypto_clear_masks(matrix_mdev->kvm);
>>
>> mutex_lock(&matrix_dev->lock);
>> vfio_ap_mdev_reset_queues(matrix_mdev->mdev);
>> kvm_put_kvm(matrix_mdev->kvm);
>> matrix_mdev->kvm = NULL;
>> + mutex_unlock(&matrix_dev->lock);
>> }
> Doesn't a flow exit the function with matrix_dev->lock held he

How can that happen? What flow?

>
> Write it with 'success oriented flow'

I'm not sure what you mean, can you clarify this statement?

>
> I didn't check if everything makes sense, but it sure looks clean.
>
> Jason

\
 
 \ /
  Last update: 2021-06-28 20:23    [W:0.184 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site