Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-13 Thread Halil Pasic
On Fri, 11 Dec 2020 16:08:53 -0500 Tony Krowiak wrote: > >>> +static void vfio_ap_mdev_put_kvm(struct ap_matrix_mdev *matrix_mdev) > >>> +{ > >>> + if (matrix_mdev->kvm) { > >>> + kvm_arch_crypto_clear_masks(matrix_mdev->kvm); > >>> + matrix_mdev->kvm->arch.crypto.pqap_hook =

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-13 Thread Halil Pasic
On Fri, 11 Dec 2020 15:52:55 -0500 Tony Krowiak wrote: > > > On 12/7/20 7:01 PM, Halil Pasic wrote: > > On Mon, 7 Dec 2020 13:50:36 -0500 > > Tony Krowiak wrote: > > > >> On 12/4/20 2:05 PM, Halil Pasic wrote: > >>> On Fri, 4 Dec 2020 09:43:59 -0500 > >>> Tony Krowiak wrote: > >>> >

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-11 Thread Tony Krowiak
On 12/7/20 7:40 PM, Halil Pasic wrote: On Mon, 7 Dec 2020 14:05:55 -0500 Tony Krowiak wrote: On 12/2/20 6:41 PM, Tony Krowiak wrote: The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a VFIO mediated device for a KVM guest is opened to receive

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Halil Pasic
On Mon, 7 Dec 2020 14:05:55 -0500 Tony Krowiak wrote: > > > On 12/2/20 6:41 PM, Tony Krowiak wrote: > > The vfio_ap device driver registers a group notifier with VFIO when the > > file descriptor for a VFIO mediated device for a KVM guest is opened to > > receive notification that the KVM

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Halil Pasic
On Mon, 7 Dec 2020 13:50:36 -0500 Tony Krowiak wrote: > On 12/4/20 2:05 PM, Halil Pasic wrote: > > On Fri, 4 Dec 2020 09:43:59 -0500 > > Tony Krowiak wrote: > > > +{ > +if (matrix_mdev->kvm) { > +(matrix_mdev->kvm); > +

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Tony Krowiak
On 12/2/20 6:41 PM, Tony Krowiak wrote: The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a VFIO mediated device for a KVM guest is opened to receive notification that the KVM pointer is set (VFIO_GROUP_NOTIFY_SET_KVM event). When the KVM pointer is

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Tony Krowiak
On 12/4/20 2:05 PM, Halil Pasic wrote: On Fri, 4 Dec 2020 09:43:59 -0500 Tony Krowiak wrote: +{ + if (matrix_mdev->kvm) { + (matrix_mdev->kvm); + matrix_mdev->kvm->arch.crypto.pqap_hook = NULL; Is a plain assignment to arch.crypto.pqap_hook apropriate, or

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Christian Borntraeger
On 07.12.20 16:24, Halil Pasic wrote: > On Fri, 4 Dec 2020 11:48:24 -0500 > Tony Krowiak wrote: > >> On 12/3/20 12:55 PM, Halil Pasic wrote: >>> On Wed, 2 Dec 2020 18:41:01 -0500 >>> Tony Krowiak wrote: >>> The vfio_ap device driver registers a group notifier with VFIO when the

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-07 Thread Halil Pasic
On Fri, 4 Dec 2020 11:48:24 -0500 Tony Krowiak wrote: > On 12/3/20 12:55 PM, Halil Pasic wrote: > > On Wed, 2 Dec 2020 18:41:01 -0500 > > Tony Krowiak wrote: > > > >> The vfio_ap device driver registers a group notifier with VFIO when the > >> file descriptor for a VFIO mediated device for a

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Halil Pasic
On Fri, 4 Dec 2020 14:46:30 -0500 Tony Krowiak wrote: > On 12/4/20 2:05 PM, Halil Pasic wrote: > > On Fri, 4 Dec 2020 09:43:59 -0500 > > Tony Krowiak wrote: > > > +{ > +if (matrix_mdev->kvm) { > +(matrix_mdev->kvm); > +

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Tony Krowiak
On 12/4/20 11:57 AM, Cornelia Huck wrote: On Fri, 4 Dec 2020 11:48:24 -0500 Tony Krowiak wrote: On 12/3/20 12:55 PM, Halil Pasic wrote: On Wed, 2 Dec 2020 18:41:01 -0500 Tony Krowiak wrote: The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Tony Krowiak
On 12/4/20 2:05 PM, Halil Pasic wrote: On Fri, 4 Dec 2020 09:43:59 -0500 Tony Krowiak wrote: +{ + if (matrix_mdev->kvm) { + (matrix_mdev->kvm); + matrix_mdev->kvm->arch.crypto.pqap_hook = NULL; Is a plain assignment to arch.crypto.pqap_hook apropriate, or

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Halil Pasic
On Fri, 4 Dec 2020 09:43:59 -0500 Tony Krowiak wrote: > >> +{ > >> + if (matrix_mdev->kvm) { > >> + (matrix_mdev->kvm); > >> + matrix_mdev->kvm->arch.crypto.pqap_hook = NULL; > > Is a plain assignment to arch.crypto.pqap_hook apropriate, or do we need > > to take more care?

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Cornelia Huck
On Fri, 4 Dec 2020 11:48:24 -0500 Tony Krowiak wrote: > On 12/3/20 12:55 PM, Halil Pasic wrote: > > On Wed, 2 Dec 2020 18:41:01 -0500 > > Tony Krowiak wrote: > > > >> The vfio_ap device driver registers a group notifier with VFIO when the > >> file descriptor for a VFIO mediated device for a

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Tony Krowiak
On 12/3/20 12:55 PM, Halil Pasic wrote: On Wed, 2 Dec 2020 18:41:01 -0500 Tony Krowiak wrote: The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a VFIO mediated device for a KVM guest is opened to receive notification that the KVM pointer is set

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-04 Thread Tony Krowiak
On 12/3/20 12:55 PM, Halil Pasic wrote: On Wed, 2 Dec 2020 18:41:01 -0500 Tony Krowiak wrote: The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a VFIO mediated device for a KVM guest is opened to receive notification that the KVM pointer is set

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-03 Thread Tony Krowiak
On 12/3/20 12:01 PM, Halil Pasic wrote: On Thu, 3 Dec 2020 11:19:07 +0100 Cornelia Huck wrote: @@ -1095,7 +1106,7 @@ static int vfio_ap_mdev_group_notifier(struct notifier_block *nb, matrix_mdev = container_of(nb, struct ap_matrix_mdev, group_notifier); if (!data) { -

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-03 Thread Halil Pasic
On Wed, 2 Dec 2020 18:41:01 -0500 Tony Krowiak wrote: > The vfio_ap device driver registers a group notifier with VFIO when the > file descriptor for a VFIO mediated device for a KVM guest is opened to > receive notification that the KVM pointer is set (VFIO_GROUP_NOTIFY_SET_KVM > event). When

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-03 Thread Halil Pasic
On Thu, 3 Dec 2020 11:19:07 +0100 Cornelia Huck wrote: > > @@ -1095,7 +1106,7 @@ static int vfio_ap_mdev_group_notifier(struct > > notifier_block *nb, > > matrix_mdev = container_of(nb, struct ap_matrix_mdev, group_notifier); > > > > if (!data) { > > - matrix_mdev->kvm =

Re: [PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-03 Thread Cornelia Huck
On Wed, 2 Dec 2020 18:41:01 -0500 Tony Krowiak wrote: > The vfio_ap device driver registers a group notifier with VFIO when the > file descriptor for a VFIO mediated device for a KVM guest is opened to > receive notification that the KVM pointer is set (VFIO_GROUP_NOTIFY_SET_KVM > event). When

[PATCH] s390/vfio-ap: Clean up vfio_ap resources when KVM pointer invalidated

2020-12-02 Thread Tony Krowiak
The vfio_ap device driver registers a group notifier with VFIO when the file descriptor for a VFIO mediated device for a KVM guest is opened to receive notification that the KVM pointer is set (VFIO_GROUP_NOTIFY_SET_KVM event). When the KVM pointer is set, the vfio_ap driver stashes the pointer