summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/vfio_ccw_private.h
diff options
context:
space:
mode:
authorCornelia Huck <cohuck@redhat.com>2019-01-08 15:53:03 +0100
committerCornelia Huck <cohuck@redhat.com>2019-04-24 14:18:51 +0200
commit4f76617378ee97c557b526cb58d3c61eb0a9c963 (patch)
tree42e9ac6864535d6d1ea1210790dfccf072eb73bb /drivers/s390/cio/vfio_ccw_private.h
parentvfio-ccw: rework ssch state handling (diff)
downloadlinux-4f76617378ee97c557b526cb58d3c61eb0a9c963.tar.xz
linux-4f76617378ee97c557b526cb58d3c61eb0a9c963.zip
vfio-ccw: protect the I/O region
Introduce a mutex to disallow concurrent reads or writes to the I/O region. This makes sure that the data the kernel or user space see is always consistent. The same mutex will be used to protect the async region as well. Reviewed-by: Eric Farman <farman@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to '')
-rw-r--r--drivers/s390/cio/vfio_ccw_private.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
index 50c52efb4fcb..32173cbd838d 100644
--- a/drivers/s390/cio/vfio_ccw_private.h
+++ b/drivers/s390/cio/vfio_ccw_private.h
@@ -28,6 +28,7 @@
* @mdev: pointer to the mediated device
* @nb: notifier for vfio events
* @io_region: MMIO region to input/output I/O arguments/results
+ * @io_mutex: protect against concurrent update of I/O regions
* @cp: channel program for the current I/O operation
* @irb: irb info received from interrupt
* @scsw: scsw info
@@ -42,6 +43,7 @@ struct vfio_ccw_private {
struct mdev_device *mdev;
struct notifier_block nb;
struct ccw_io_region *io_region;
+ struct mutex io_mutex;
struct channel_program cp;
struct irb irb;