summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/vfio_ccw_cp.h
diff options
context:
space:
mode:
authorCornelia Huck2019-01-21 09:55:18 +0100
committerCornelia Huck2019-04-24 14:18:51 +0200
commit71189f263f8a3db7b72ca75be14e7309375e8707 (patch)
tree252d086e298f5f219b50026a022ab02681bfcea7 /drivers/s390/cio/vfio_ccw_cp.h
parents390/cpum_cf_diag: Add support for CPU-MF SVN 6 (diff)
downloadkernel-qcow2-linux-71189f263f8a3db7b72ca75be14e7309375e8707.tar.gz
kernel-qcow2-linux-71189f263f8a3db7b72ca75be14e7309375e8707.tar.xz
kernel-qcow2-linux-71189f263f8a3db7b72ca75be14e7309375e8707.zip
vfio-ccw: make it safe to access channel programs
When we get a solicited interrupt, the start function may have been cleared by a csch, but we still have a channel program structure allocated. Make it safe to call the cp accessors in any case, so we can call them unconditionally. While at it, also make sure that functions called from other parts of the code return gracefully if the channel program structure has not been initialized (even though that is a bug in the caller). Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'drivers/s390/cio/vfio_ccw_cp.h')
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.h b/drivers/s390/cio/vfio_ccw_cp.h
index a4b74fb1aa57..3c20cd208da5 100644
--- a/drivers/s390/cio/vfio_ccw_cp.h
+++ b/drivers/s390/cio/vfio_ccw_cp.h
@@ -21,6 +21,7 @@
* @ccwchain_list: list head of ccwchains
* @orb: orb for the currently processed ssch request
* @mdev: the mediated device to perform page pinning/unpinning
+ * @initialized: whether this instance is actually initialized
*
* @ccwchain_list is the head of a ccwchain list, that contents the
* translated result of the guest channel program that pointed out by
@@ -30,6 +31,7 @@ struct channel_program {
struct list_head ccwchain_list;
union orb orb;
struct device *mdev;
+ bool initialized;
};
extern int cp_init(struct channel_program *cp, struct device *mdev,