OSDN Git Service

vfio: ccw: bypass bad idaw address when fetching IDAL ccws
authorDong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Wed, 11 Oct 2017 02:38:21 +0000 (04:38 +0200)
committerCornelia Huck <cohuck@redhat.com>
Mon, 16 Oct 2017 09:10:13 +0000 (11:10 +0200)
commit688c29533ffc969773bc860d07d3a5f1995f5878
tree1ec90512baba9a1fbe72d0b3f86918af7cb6d53c
parentfe3af62553896d2a6b13c931137406681d76c3e4
vfio: ccw: bypass bad idaw address when fetching IDAL ccws

We currently return the same error code (-EFAULT) to indicate two
different error cases:
1. a bug in vfio-ccw implementation has been found.
2. a buggy channel program has been detected.

This brings difficulty for userland program (specifically Qemu) to
handle.

Let's use -EFAULT to only indicate the first case. For the second
case, we simply hand over the ccws to lower level for further
handling.

Notice:
Once a bad idaw address is detected, the current behavior is to
suppress the ssch. With this fix, the channel program will be
accepted, and part of the channel program (the part ahead of
the bad idaw) could possibly be executed by the device before
I/O conclusion.

Suggested-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Message-Id: <20171011023822.42948-2-bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
drivers/s390/cio/vfio_ccw_cp.c