On 09/21/2017 11:44 AM, Pierre Morel wrote: > On 19/09/2017 20:27, Halil Pasic wrote: >> Replace direct access which implicitly assumes no IDA >> or MIDA with the new ccw data stream interface which should >> cope with these transparently in the future. >> >> Signed-off-by: Halil Pasic <pa...@linux.vnet.ibm.com> >> Reviewed-by: Pierre Morel<pmo...@linux.vnet.ibm.com> >> --- >> hw/s390x/virtio-ccw.c | 157 >> +++++++++++++++----------------------------------- >> 1 file changed, 46 insertions(+), 111 deletions(-) >> >> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c >> index b1976fdd19..d024f8b2d3 100644 >> --- a/hw/s390x/virtio-ccw.c >> +++ b/hw/s390x/virtio-ccw.c >> @@ -287,49 +287,19 @@ static int virtio_ccw_handle_set_vq(SubchDev *sch, >> CCW1 ccw, bool check_len, >> return -EFAULT; >> } >> if (is_legacy) { >> - linfo.queue = address_space_ldq_be(&address_space_memory, ccw.cda, >> - MEMTXATTRS_UNSPECIFIED, NULL); >> - linfo.align = address_space_ldl_be(&address_space_memory, >> - ccw.cda + sizeof(linfo.queue), >> - MEMTXATTRS_UNSPECIFIED, >> - NULL); >> - linfo.index = address_space_lduw_be(&address_space_memory, >> - ccw.cda + sizeof(linfo.queue) >> - + sizeof(linfo.align), >> - MEMTXATTRS_UNSPECIFIED, >> - NULL); >> - linfo.num = address_space_lduw_be(&address_space_memory, >> - ccw.cda + sizeof(linfo.queue) >> - + sizeof(linfo.align) >> - + sizeof(linfo.index), >> - MEMTXATTRS_UNSPECIFIED, >> - NULL); > > Here again, I oversaw this. > Sorry. > >> + ccw_dstream_read(&sch->cds, linfo); > > Same as for patch 2/5: > Shouldn't you test the return value here? >
It's keep the change minimal policy. Later we can discuss tightening the checks. For now I don't want to introduce any new ones. Halil