[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210303204211.4c021c25.pasic@linux.ibm.com>
Date: Wed, 3 Mar 2021 20:42:11 +0100
From: Halil Pasic <pasic@...ux.ibm.com>
To: Tony Krowiak <akrowiak@...ux.ibm.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, stable@...r.kernel.org,
borntraeger@...ibm.com, cohuck@...hat.com, kwankhede@...dia.com,
pbonzini@...hat.com, alex.williamson@...hat.com,
pasic@...ux.vnet.ibm.com
Subject: Re: [PATCH v3 1/1] s390/vfio-ap: fix circular lockdep when
setting/clearing crypto masks
On Wed, 3 Mar 2021 11:41:22 -0500
Tony Krowiak <akrowiak@...ux.ibm.com> wrote:
> > How do you exect userspace to react to this -ENODEV?
>
> The VFIO_DEVICE_RESET ioctl expects a return code.
> The vfio_ap_mdev_reset_queues() function can return -EIO or
> -EBUSY, so I would expect userspace to handle -ENODEV
> similarly to -EIO or any other non-zero return code. I also
> looked at all of the VFIO_DEVICE_RESET calls from QEMU to see
> how the return from the ioctl call is handled:
>
> * ap: reports the reset failed along with the rc
And carries on as if nothing happened. There is not much smart
userspace can do in such a situation. Therefore the reset really
should not fail.
Please note that in this particular case, if the userspace would
opt for a retry, we would most likely end up in a retry loop.
> * ccw: doesn't check the rc
> * pci: kind of hard to follow without digging deep, but definitely
> handles non-zero rc.
>
> I think the caller should be notified whether the queues were
> successfully reset or not, and why; in this case, the answer is
> there are no devices to reset.
That is the wrong answer. The ioctl is supposed to reset the
ap_matrix_mdev device. The ap_matrix_mdev device still exists. Thus
returning -ENODEV is bugous.
Regards,
Halil
Powered by blists - more mailing lists