diff options
author | Cornelia Huck <cohuck@redhat.com> | 2019-01-08 17:53:03 +0300 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2019-04-24 15:18:51 +0300 |
commit | 4f76617378ee97c557b526cb58d3c61eb0a9c963 (patch) | |
tree | 42e9ac6864535d6d1ea1210790dfccf072eb73bb /drivers/s390/cio/vfio_ccw_private.h | |
parent | 690f6a1581c7c08e85451f62bcbfe40f29072842 (diff) | |
download | linux-4f76617378ee97c557b526cb58d3c61eb0a9c963.tar.xz |
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 'drivers/s390/cio/vfio_ccw_private.h')
-rw-r--r-- | drivers/s390/cio/vfio_ccw_private.h | 2 |
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; |