From: Tony Krowiak Date: Tue, 25 Sep 2018 23:16:29 +0000 (-0400) Subject: s390: vfio-ap: implement VFIO_DEVICE_RESET ioctl X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cd8a377e3b40002cd7983b53f384456393908b7e;p=android-x86%2Fkernel.git s390: vfio-ap: implement VFIO_DEVICE_RESET ioctl Implements the VFIO_DEVICE_RESET ioctl. This ioctl zeroizes all of the AP queues assigned to the guest. Signed-off-by: Tony Krowiak Reviewed-by: Halil Pasic Reviewed-by: Pierre Morel Reviewed-by: Cornelia Huck Tested-by: Michael Mueller Tested-by: Farhan Ali Tested-by: Pierre Morel Message-Id: <20180925231641.4954-15-akrowiak@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger --- diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index 619900c56cd6..d3d9eb72b0f1 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -917,7 +917,7 @@ static int vfio_ap_mdev_get_device_info(unsigned long arg) if (info.argsz < minsz) return -EINVAL; - info.flags = VFIO_DEVICE_FLAGS_AP; + info.flags = VFIO_DEVICE_FLAGS_AP | VFIO_DEVICE_FLAGS_RESET; info.num_regions = 0; info.num_irqs = 0; @@ -933,6 +933,9 @@ static ssize_t vfio_ap_mdev_ioctl(struct mdev_device *mdev, case VFIO_DEVICE_GET_INFO: ret = vfio_ap_mdev_get_device_info(arg); break; + case VFIO_DEVICE_RESET: + ret = vfio_ap_mdev_reset_queues(mdev); + break; default: ret = -EOPNOTSUPP; break;