[{"id":1770623,"web_url":"http://patchwork.ozlabs.org/comment/1770623/","msgid":"<20170919024531.GC5274@bjsdjshi@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-19T02:45:31","subject":"Re: [Qemu-devel] [PATCH v2 2/4] s390x/css: use ccw data stream","submitter":{"id":68897,"url":"http://patchwork.ozlabs.org/api/people/68897/","name":"Dong Jia Shi","email":"bjsdjshi@linux.vnet.ibm.com"},"content":"* Halil Pasic <pasic@linux.vnet.ibm.com> [2017-09-13 13:50:27 +0200]:\n\n> Replace direct access which implicitly assumes no IDA\n> or MIDA with the new ccw data stream interface which should\n> cope with these transparently in the future.\n> \n> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n> ---\n>  hw/s390x/css.c | 9 +++++----\n>  1 file changed, 5 insertions(+), 4 deletions(-)\n> \n> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n> index e8d2016563..6b0cd8861b 100644\n> --- a/hw/s390x/css.c\n> +++ b/hw/s390x/css.c\n> @@ -890,6 +890,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>      }\n> \n>      /* Look at the command. */\n> +    ccw_dstream_init(&sch->cds, &ccw, &(sch->orb));\n>      switch (ccw.cmd_code) {\n>      case CCW_CMD_NOOP:\n>          /* Nothing to do. */\n> @@ -903,8 +904,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>              }\n>          }\n>          len = MIN(ccw.count, sizeof(sch->sense_data));\n> -        cpu_physical_memory_write(ccw.cda, sch->sense_data, len);\n> -        sch->curr_status.scsw.count = ccw.count - len;\n> +        ccw_dstream_write_buf(&sch->cds, sch->sense_data, len);\n> +        sch->curr_status.scsw.count = ccw_dstream_residual_count(&sch->cds);\n>          memset(sch->sense_data, 0, sizeof(sch->sense_data));\n>          ret = 0;\n>          break;\n> @@ -930,8 +931,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>          } else {\n>              sense_id.reserved = 0;\n>          }\n> -        cpu_physical_memory_write(ccw.cda, &sense_id, len);\n> -        sch->curr_status.scsw.count = ccw.count - len;\n> +        ccw_dstream_write_buf(&sch->cds, &sense_id, len);\n> +        sch->curr_status.scsw.count = ccw_dstream_residual_count(&sch->cds);\n>          ret = 0;\n>          break;\n>      }\n> -- \n> 2.13.5\n> \n\nReviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xx6h409S3z9rxm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 12:46:08 +1000 (AEST)","from localhost ([::1]:39799 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1du8Xz-0003sD-Qg\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 22:46:03 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39364)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1du8Xe-0003ru-E1\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 22:45:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1du8Xb-00075H-3p\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 22:45:42 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37790\n\thelo=mx0a-001b2d01.pphosted.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bjsdjshi@linux.vnet.ibm.com>)\n\tid 1du8Xa-000758-Ts\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 22:45:39 -0400","from pps.filterd (m0098417.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8J2hx5V104584\n\tfor <qemu-devel@nongnu.org>; Mon, 18 Sep 2017 22:45:37 -0400","from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d2n7332dq-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Mon, 18 Sep 2017 22:45:36 -0400","from localhost\n\tby e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <bjsdjshi@linux.vnet.ibm.com>;\n\tMon, 18 Sep 2017 22:45:36 -0400","from b01cxnp22034.gho.pok.ibm.com (9.57.198.24)\n\tby e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tMon, 18 Sep 2017 22:45:34 -0400","from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com\n\t[9.57.199.111])\n\tby b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v8J2jXNc53149698; Tue, 19 Sep 2017 02:45:33 GMT","from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 25DEFAC041;\n\tMon, 18 Sep 2017 22:46:05 -0400 (EDT)","from localhost (unknown [9.115.112.23])\n\tby b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 55295AC03F;\n\tMon, 18 Sep 2017 22:46:04 -0400 (EDT)"],"Date":"Tue, 19 Sep 2017 10:45:31 +0800","From":"Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>","To":"Halil Pasic <pasic@linux.vnet.ibm.com>","Mail-Followup-To":"Halil Pasic <pasic@linux.vnet.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>,\n\tDong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,\n\tPierre Morel <pmorel@linux.vnet.ibm.com>, qemu-devel@nongnu.org","References":"<20170913115029.47626-1-pasic@linux.vnet.ibm.com>\n\t<20170913115029.47626-3-pasic@linux.vnet.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170913115029.47626-3-pasic@linux.vnet.ibm.com>","Organization":"(IBM CSL)","X-URL":"http://ibm.com/","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-TM-AS-GCONF":"00","x-cbid":"17091902-0036-0000-0000-0000026CB5C3","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007759; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000230; SDB=6.00919069; UDB=6.00461732;\n\tIPR=6.00699297; \n\tBA=6.00005595; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017202;\n\tXFM=3.00000015; UTC=2017-09-19 02:45:35","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091902-0037-0000-0000-000041D06C03","Message-Id":"<20170919024531.GC5274@bjsdjshi@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-19_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709190039","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.158.5","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] s390x/css: use ccw data stream","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>,\n\tCornelia Huck <cohuck@redhat.com>,\n\tPierre Morel <pmorel@linux.vnet.ibm.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1771049,"web_url":"http://patchwork.ozlabs.org/comment/1771049/","msgid":"<0a029ec8-ff4c-e56d-4ef1-750fc8c49e19@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-19T13:57:16","subject":"Re: [Qemu-devel] [PATCH v2 2/4] s390x/css: use ccw data stream","submitter":{"id":66825,"url":"http://patchwork.ozlabs.org/api/people/66825/","name":"Pierre Morel","email":"pmorel@linux.vnet.ibm.com"},"content":"On 13/09/2017 13:50, Halil Pasic wrote:\n> Replace direct access which implicitly assumes no IDA\n> or MIDA with the new ccw data stream interface which should\n> cope with these transparently in the future.\n> \n> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n> ---\n>   hw/s390x/css.c | 9 +++++----\n>   1 file changed, 5 insertions(+), 4 deletions(-)\n> \n> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n> index e8d2016563..6b0cd8861b 100644\n> --- a/hw/s390x/css.c\n> +++ b/hw/s390x/css.c\n> @@ -890,6 +890,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>       }\n> \n>       /* Look at the command. */\n> +    ccw_dstream_init(&sch->cds, &ccw, &(sch->orb));\n>       switch (ccw.cmd_code) {\n>       case CCW_CMD_NOOP:\n>           /* Nothing to do. */\n> @@ -903,8 +904,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>               }\n>           }\n>           len = MIN(ccw.count, sizeof(sch->sense_data));\n> -        cpu_physical_memory_write(ccw.cda, sch->sense_data, len);\n> -        sch->curr_status.scsw.count = ccw.count - len;\n> +        ccw_dstream_write_buf(&sch->cds, sch->sense_data, len);\n> +        sch->curr_status.scsw.count = ccw_dstream_residual_count(&sch->cds);\n>           memset(sch->sense_data, 0, sizeof(sch->sense_data));\n>           ret = 0;\n>           break;\n> @@ -930,8 +931,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,\n>           } else {\n>               sense_id.reserved = 0;\n>           }\n> -        cpu_physical_memory_write(ccw.cda, &sense_id, len);\n> -        sch->curr_status.scsw.count = ccw.count - len;\n> +        ccw_dstream_write_buf(&sch->cds, &sense_id, len);\n> +        sch->curr_status.scsw.count = ccw_dstream_residual_count(&sch->cds);\n>           ret = 0;\n>           break;\n>       }\n> \n\nReviewed-by: Pierre Morel<pmorel@linux.vnet.ibm.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxPbK1Y6wz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 23:58:05 +1000 (AEST)","from localhost ([::1]:43093 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duJ2J-0007dp-AK\n\tfor incoming@patchwork.ozlabs.org; Tue, 19 Sep 2017 09:58:03 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35749)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pmorel@linux.vnet.ibm.com>) id 1duJ1i-0007cJ-LQ\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 09:57:27 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pmorel@linux.vnet.ibm.com>) id 1duJ1e-0002wF-LI\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 09:57:26 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57392)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pmorel@linux.vnet.ibm.com>)\n\tid 1duJ1e-0002vp-Cz\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 09:57:22 -0400","from pps.filterd (m0098409.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8JDtuHP141012\n\tfor <qemu-devel@nongnu.org>; Tue, 19 Sep 2017 09:57:21 -0400","from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d30001eck-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Tue, 19 Sep 2017 09:57:20 -0400","from localhost\n\tby e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <pmorel@linux.vnet.ibm.com>;\n\tTue, 19 Sep 2017 14:57:18 +0100","from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195)\n\tby e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 19 Sep 2017 14:57:17 +0100","from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com\n\t[9.149.105.59])\n\tby b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8JDvGke16449760; Tue, 19 Sep 2017 13:57:16 GMT","from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C7F22A404D;\n\tTue, 19 Sep 2017 14:53:18 +0100 (BST)","from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 96D29A4040;\n\tTue, 19 Sep 2017 14:53:18 +0100 (BST)","from [9.145.21.76] (unknown [9.145.21.76])\n\tby d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tTue, 19 Sep 2017 14:53:18 +0100 (BST)"],"To":"Halil Pasic <pasic@linux.vnet.ibm.com>, Cornelia Huck <cohuck@redhat.com>","References":"<20170913115029.47626-1-pasic@linux.vnet.ibm.com>\n\t<20170913115029.47626-3-pasic@linux.vnet.ibm.com>","From":"Pierre Morel <pmorel@linux.vnet.ibm.com>","Date":"Tue, 19 Sep 2017 15:57:16 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170913115029.47626-3-pasic@linux.vnet.ibm.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","X-TM-AS-GCONF":"00","x-cbid":"17091913-0040-0000-0000-000003FB601B","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17091913-0041-0000-0000-0000209C91D3","Message-Id":"<0a029ec8-ff4c-e56d-4ef1-750fc8c49e19@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-19_06:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709190198","Content-Transfer-Encoding":"quoted-printable","X-MIME-Autoconverted":"from 8bit to quoted-printable by\n\tmx0a-001b2d01.pphosted.com id v8JDtuHP141012","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.156.1","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] s390x/css: use ccw data stream","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>, qemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]