diff mbox series

[v12,02/17] s390/vfio-ap: decrement reference count to KVM

Message ID 20201124214016.3013-3-akrowiak@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390/vfio-ap: dynamic configuration support | expand

Commit Message

Anthony Krowiak Nov. 24, 2020, 9:40 p.m. UTC
Decrement the reference count to KVM when notified that KVM pointer is
invalidated via the vfio group notifier.

Signed-off-by: Tony Krowiak <akrowiak@stny.rr.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
---
 drivers/s390/crypto/vfio_ap_ops.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Halil Pasic Nov. 26, 2020, 9:42 a.m. UTC | #1
On Tue, 24 Nov 2020 16:40:01 -0500
Tony Krowiak <akrowiak@linux.ibm.com> wrote:

> Decrement the reference count to KVM when notified that KVM pointer is
> invalidated via the vfio group notifier.

Can you please explain more thoroughly. Is this a bug you found? If
yes do we need to backport it (cc stabe, fixes tag)? 

It doesn't see related to the objective of the series. If not related,
why not spin it separately?


> 
> Signed-off-by: Tony Krowiak <akrowiak@stny.rr.com>

This s-o-b is probably by accident.

> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
> ---
>  drivers/s390/crypto/vfio_ap_ops.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index 66fd9784a156..31e39c1f6e56 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -1095,7 +1095,11 @@ static int vfio_ap_mdev_group_notifier(struct notifier_block *nb,
>  	matrix_mdev = container_of(nb, struct ap_matrix_mdev, group_notifier);
>  
>  	if (!data) {
> +		if (matrix_mdev->kvm)
> +			kvm_put_kvm(matrix_mdev->kvm);
> +
>  		matrix_mdev->kvm = NULL;
> +
>  		return NOTIFY_OK;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
index 66fd9784a156..31e39c1f6e56 100644
--- a/drivers/s390/crypto/vfio_ap_ops.c
+++ b/drivers/s390/crypto/vfio_ap_ops.c
@@ -1095,7 +1095,11 @@  static int vfio_ap_mdev_group_notifier(struct notifier_block *nb,
 	matrix_mdev = container_of(nb, struct ap_matrix_mdev, group_notifier);
 
 	if (!data) {
+		if (matrix_mdev->kvm)
+			kvm_put_kvm(matrix_mdev->kvm);
+
 		matrix_mdev->kvm = NULL;
+
 		return NOTIFY_OK;
 	}