s390: vfio-ap: implement VFIO_DEVICE_RESET ioctl
authorTony Krowiak <akrowiak@linux.ibm.com>
Tue, 25 Sep 2018 23:16:29 +0000 (19:16 -0400)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 28 Sep 2018 13:50:11 +0000 (15:50 +0200)
Implements the VFIO_DEVICE_RESET ioctl. This ioctl zeroizes
all of the AP queues assigned to the guest.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Tested-by: Michael Mueller <mimu@linux.ibm.com>
Tested-by: Farhan Ali <alifm@linux.ibm.com>
Tested-by: Pierre Morel <pmorel@linux.ibm.com>
Message-Id: <20180925231641.4954-15-akrowiak@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
drivers/s390/crypto/vfio_ap_ops.c

index 619900c56cd6b724fb2016fbbef95dc93122c699..d3d9eb72b0f1ae1216f528b38e1c7e6440893ab9 100644 (file)
@@ -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;