[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/13] s390x/css: handle format-0 TIC CCW correctly
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 13/13] s390x/css: handle format-0 TIC CCW correctly |
Date: |
Fri, 24 Feb 2017 10:22:59 +0100 |
From: Dong Jia Shi <address@hidden>
For TIC CCW, bit positions 8-32 of the format-1 CCW must contain zeros;
otherwise, a program-check condition is generated. For format-0 TIC CCWs,
bits 32-63 are ignored.
To convert TIC from format-0 CCW to format-1 CCW correctly, let's clear
bits 8-32 to guarantee compatibility.
Reviewed-by: Pierre Morel <address@hidden>
Signed-off-by: Dong Jia Shi <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/css.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 0f2580d644..e32b2a4d42 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -368,13 +368,16 @@ static CCW1 copy_ccw_from_guest(hwaddr addr, bool fmt1)
ret.cda = be32_to_cpu(tmp1.cda);
} else {
cpu_physical_memory_read(addr, &tmp0, sizeof(tmp0));
- ret.cmd_code = tmp0.cmd_code;
- ret.flags = tmp0.flags;
- ret.count = be16_to_cpu(tmp0.count);
- ret.cda = be16_to_cpu(tmp0.cda1) | (tmp0.cda0 << 16);
- if ((ret.cmd_code & 0x0f) == CCW_CMD_TIC) {
- ret.cmd_code &= 0x0f;
+ if ((tmp0.cmd_code & 0x0f) == CCW_CMD_TIC) {
+ ret.cmd_code = CCW_CMD_TIC;
+ ret.flags = 0;
+ ret.count = 0;
+ } else {
+ ret.cmd_code = tmp0.cmd_code;
+ ret.flags = tmp0.flags;
+ ret.count = be16_to_cpu(tmp0.count);
}
+ ret.cda = be16_to_cpu(tmp0.cda1) | (tmp0.cda0 << 16);
}
return ret;
}
--
2.11.0
- [Qemu-devel] [PULL 05/13] virtio-ccw: add virtio-crypto-ccw device, (continued)
- [Qemu-devel] [PULL 05/13] virtio-ccw: add virtio-crypto-ccw device, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 02/13] s390x/kvm: detect some program check loops, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 03/13] s390x/flic: fail migration on source already, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 06/13] virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 04/13] virtio-ccw: handle virtio 1 only devices, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 07/13] s390x: add property adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 09/13] s390x: bump ADAPTER_ROUTES_MAX_GSI, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 08/13] virtio-ccw: check flic->adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 10/13] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 12/13] s390x/arch_dump: pass cpuid into notes sections, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 13/13] s390x/css: handle format-0 TIC CCW correctly,
Cornelia Huck <=
- [Qemu-devel] [PULL 11/13] s390x/arch_dump: use proper note name and note size, Cornelia Huck, 2017/02/24
- Re: [Qemu-devel] [PULL 00/13] s390x patches for 2.9, Peter Maydell, 2017/02/25