aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-skeys-kvm.c
diff options
context:
space:
mode:
authorPeter Jin <pjin@linux.ibm.com>2022-10-27 23:23:41 +0200
committerThomas Huth <thuth@redhat.com>2022-11-06 12:27:35 +0100
commitf53b033e4cd2e7706df3cca04f3bf3c5ffc6b08c (patch)
tree4508abdf82c2ce2d2155dbebd5eb72f5af345816 /hw/s390x/s390-skeys-kvm.c
parent765de32d87db65abf443d6a5d7097d42fc6e48de (diff)
downloadqemu-f53b033e4cd2e7706df3cca04f3bf3c5ffc6b08c.zip
qemu-f53b033e4cd2e7706df3cca04f3bf3c5ffc6b08c.tar.gz
qemu-f53b033e4cd2e7706df3cca04f3bf3c5ffc6b08c.tar.bz2
s390x/css: revert SCSW ctrl/flag bits on error
Revert the control and flag bits in the subchannel status word in case the SSCH operation fails with non-zero CC (ditto for CSCH and HSCH). According to POPS, the control and flag bits are only changed if SSCH, CSCH, and HSCH return CC 0, and no other action should be taken otherwise. In order to simulate that after the fact, the bits need to be reverted on non-zero CC. While the do_subchannel_work logic for virtual (virtio) devices will return condition code 0, passthrough (vfio) devices may encounter errors from either the host kernel or real hardware that need to be accounted for after this point. This includes restoring the state of the Subchannel Status Word to reflect the subchannel, as these bits would not be set in the event of a non-zero condition code from the affected instructions. Experimentation has shown that a failure on a START SUBCHANNEL (SSCH) to a passthrough device would leave the subchannel with the START PENDING activity control bit set, thus blocking subsequent SSCH operations in css_do_ssch() until some form of error recovery was undertaken since no interrupt would be expected. Signed-off-by: Peter Jin <pjin@linux.ibm.com> Message-Id: <20221027212341.2904795-1-pjin@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> [thuth: Updated the commit description to Eric's suggestion] Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/s390x/s390-skeys-kvm.c')
0 files changed, 0 insertions, 0 deletions