[{"id":1771650,"web_url":"http://patchwork.ozlabs.org/comment/1771650/","msgid":"<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-20T07:47:51","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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-19 20:27:44 +0200]:\n\n> The architecture mandates the addresses to be  accessed on the first\n> indirection level (that is, the data addresses without IDA, and the\n> (M)IDAW addresses with (M)IDA) to be checked against an CCW format\n> dependent limit maximum address.  If a violation is detected, the storage\n> access is not to be performed and a channel program check needs to be\n> generated. As of today, we fail to do this check.\n> \n> Let us stick even closer to the architecture specification.\n> \n> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n> ---\n>  hw/s390x/css.c         | 10 ++++++++++\n>  include/hw/s390x/css.h |  1 +\n>  2 files changed, 11 insertions(+)\n> \n> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n> index 6b0cd8861b..2d37a9ddde 100644\n> --- a/hw/s390x/css.c\n> +++ b/hw/s390x/css.c\n> @@ -795,6 +795,11 @@ static inline int cds_check_len(CcwDataStream *cds, int len)\n>      return cds->flags & CDS_F_STREAM_BROKEN ? -EINVAL : len;\n>  }\n> \n> +static inline bool cds_ccw_addrs_ok(hwaddr addr, int len, bool ccw_fmt1)\n> +{\n> +    return (addr + len) < (ccw_fmt1 ? (1UL << 31) : (1UL << 24));\n> +}\n> +\n>  static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,\n>                                    CcwDataStreamOp op)\n>  {\n> @@ -804,6 +809,9 @@ static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,\n>      if (ret <= 0) {\n>          return ret;\n>      }\n> +    if (!cds_ccw_addrs_ok(cds->cda, len, cds->flags & CDS_F_FMT)) {\n> +        return -EINVAL; /* channel program check */\n> +    }\n>      if (op == CDS_OP_A) {\n>          goto incr;\n>      }\n> @@ -828,7 +836,9 @@ void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb)\n>      g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW));\n>      cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2K ? CDS_F_I2K : 0) |\n>                   (orb->ctrl0 & ORB_CTRL0_MASK_C64 ? CDS_F_C64 : 0) |\n> +                 (orb->ctrl0 & ORB_CTRL0_MASK_FMT ? CDS_F_FMT : 0) |\nThis reminds me one more question:\nCalling ccw_dsteram_init() after copy_ccw_from_guest() may lead to a\nfmt-1 @ccw with an @orb that designates fmt-0 ccw. This sounds insane.\n\n>                   (ccw->flags & CCW_FLAG_IDA ? CDS_F_IDA : 0);\n> +\n>      cds->count = ccw->count;\n>      cds->cda_orig = ccw->cda;\n>      ccw_dstream_rewind(cds);\n> diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h\n> index 078356e94c..69b374730e 100644\n> --- a/include/hw/s390x/css.h\n> +++ b/include/hw/s390x/css.h\n> @@ -87,6 +87,7 @@ typedef struct CcwDataStream {\n>  #define CDS_F_MIDA  0x02\n>  #define CDS_F_I2K   0x04\n>  #define CDS_F_C64   0x08\n> +#define CDS_F_FMT   0x10 /* CCW format-1 */\n>  #define CDS_F_STREAM_BROKEN  0x80\n>      uint8_t flags;\n>      uint8_t at_idaw;\n> -- \n> 2.13.5\n>","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 3xxsLX5H8Fz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 17:48:34 +1000 (AEST)","from localhost ([::1]:47253 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 1duZkE-00048T-Ux\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 03:48:30 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:34362)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1duZjn-00048K-6Y\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:48:04 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1duZjj-0007qc-2p\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:48:03 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42160)\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 1duZji-0007mM-Pc\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 03:47:59 -0400","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8K7i89m039729\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 03:47:57 -0400","from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d3cmrgvyr-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 03:47:57 -0400","from localhost\n\tby e32.co.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\tWed, 20 Sep 2017 01:47:56 -0600","from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)\n\tby e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 20 Sep 2017 01:47:53 -0600","from b03ledav003.gho.boulder.ibm.com\n\t(b03ledav003.gho.boulder.ibm.com [9.17.130.234])\n\tby b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8K7lrJU57475140; Wed, 20 Sep 2017 00:47:53 -0700","from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id E54F36A03D;\n\tWed, 20 Sep 2017 01:47:52 -0600 (MDT)","from localhost (unknown [9.115.112.23])\n\tby b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 3A8C66A03B;\n\tWed, 20 Sep 2017 01:47:52 -0600 (MDT)"],"Date":"Wed, 20 Sep 2017 15:47:51 +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":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170919182745.90280-5-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":"17092007-0004-0000-0000-000012F2E4B5","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007766; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000230; SDB=6.00919650; UDB=6.00462040;\n\tIPR=6.00699877; \n\tBA=6.00005598; 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.00017219;\n\tXFM=3.00000015; UTC=2017-09-20 07:47:55","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092007-0005-0000-0000-00008429A575","Message-Id":"<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-20_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-1709200107","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 v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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":1771662,"web_url":"http://patchwork.ozlabs.org/comment/1771662/","msgid":"<20170920100640.79900c9f.cohuck@redhat.com>","list_archive_url":null,"date":"2017-09-20T08:06:40","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/","name":"Cornelia Huck","email":"cohuck@redhat.com"},"content":"On Tue, 19 Sep 2017 20:27:44 +0200\nHalil Pasic <pasic@linux.vnet.ibm.com> wrote:\n\n> The architecture mandates the addresses to be  accessed on the first\n> indirection level (that is, the data addresses without IDA, and the\n> (M)IDAW addresses with (M)IDA) to be checked against an CCW format\n> dependent limit maximum address.  If a violation is detected, the storage\n> access is not to be performed and a channel program check needs to be\n> generated. As of today, we fail to do this check.\n> \n> Let us stick even closer to the architecture specification.\n> \n> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n> ---\n>  hw/s390x/css.c         | 10 ++++++++++\n>  include/hw/s390x/css.h |  1 +\n>  2 files changed, 11 insertions(+)\n> \n> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n> index 6b0cd8861b..2d37a9ddde 100644\n> --- a/hw/s390x/css.c\n> +++ b/hw/s390x/css.c\n> @@ -795,6 +795,11 @@ static inline int cds_check_len(CcwDataStream *cds, int len)\n>      return cds->flags & CDS_F_STREAM_BROKEN ? -EINVAL : len;\n>  }\n>  \n> +static inline bool cds_ccw_addrs_ok(hwaddr addr, int len, bool ccw_fmt1)\n\ncds_cda_limit_ok?\n\n> +{\n> +    return (addr + len) < (ccw_fmt1 ? (1UL << 31) : (1UL << 24));\n> +}\n> +\n>  static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,\n>                                    CcwDataStreamOp op)\n>  {\n\nLooks good.","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>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=cohuck@redhat.com"],"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 3xxsmF1wM2z9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 18:07:25 +1000 (AEST)","from localhost ([::1]:47322 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 1dua2V-0000kD-C7\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 04:07:23 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52321)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dua20-0000hQ-5a\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 04:06:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dua1u-0002DH-FC\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 04:06:52 -0400","from mx1.redhat.com ([209.132.183.28]:55860)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <cohuck@redhat.com>) id 1dua1u-0002BR-9Q\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 04:06:46 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 280F83296;\n\tWed, 20 Sep 2017 08:06:45 +0000 (UTC)","from gondolin (ovpn-117-98.ams2.redhat.com [10.36.117.98])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1C8C95D6A4;\n\tWed, 20 Sep 2017 08:06:42 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 280F83296","Date":"Wed, 20 Sep 2017 10:06:40 +0200","From":"Cornelia Huck <cohuck@redhat.com>","To":"Halil Pasic <pasic@linux.vnet.ibm.com>","Message-ID":"<20170920100640.79900c9f.cohuck@redhat.com>","In-Reply-To":"<20170919182745.90280-5-pasic@linux.vnet.ibm.com>","References":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>","Organization":"Red Hat GmbH","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tWed, 20 Sep 2017 08:06:45 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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\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":1771835,"web_url":"http://patchwork.ozlabs.org/comment/1771835/","msgid":"<20170920102537.6b329909.cohuck@redhat.com>","list_archive_url":null,"date":"2017-09-20T08:25:37","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/","name":"Cornelia Huck","email":"cohuck@redhat.com"},"content":"On Wed, 20 Sep 2017 15:47:51 +0800\nDong Jia Shi <bjsdjshi@linux.vnet.ibm.com> wrote:\n\n> * Halil Pasic <pasic@linux.vnet.ibm.com> [2017-09-19 20:27:44 +0200]:\n\n> > @@ -828,7 +836,9 @@ void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb)\n> >      g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW));\n> >      cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2K ? CDS_F_I2K : 0) |\n> >                   (orb->ctrl0 & ORB_CTRL0_MASK_C64 ? CDS_F_C64 : 0) |\n> > +                 (orb->ctrl0 & ORB_CTRL0_MASK_FMT ? CDS_F_FMT : 0) |  \n> This reminds me one more question:\n> Calling ccw_dsteram_init() after copy_ccw_from_guest() may lead to a\n> fmt-1 @ccw with an @orb that designates fmt-0 ccw. This sounds insane.\n\nThat's just a consequence of us translating everything to format-1\nccws. A bit confusing, but no problem if we pay attention to the format\nbit everywhere it makes a difference.","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>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=cohuck@redhat.com"],"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 3xy0dB4t4Qz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 23:16:46 +1000 (AEST)","from localhost ([::1]:48020 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 1duers-0002Xy-Lt\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 09:16:44 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42153)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dueni-0008Bc-Ri\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:12:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1duenD-0007D1-0H\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:12:26 -0400","from mx1.redhat.com ([209.132.183.28]:35410)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <cohuck@redhat.com>) id 1duenC-0007Bg-O5\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:11:54 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id DD6EF7F3E3;\n\tWed, 20 Sep 2017 08:25:41 +0000 (UTC)","from gondolin (ovpn-117-98.ams2.redhat.com [10.36.117.98])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id BB72E60240;\n\tWed, 20 Sep 2017 08:25:40 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com DD6EF7F3E3","Date":"Wed, 20 Sep 2017 10:25:37 +0200","From":"Cornelia Huck <cohuck@redhat.com>","To":"Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>","Message-ID":"<20170920102537.6b329909.cohuck@redhat.com>","In-Reply-To":"<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>","References":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>\n\t<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>","Organization":"Red Hat GmbH","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tWed, 20 Sep 2017 08:25:42 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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":"Halil Pasic <pasic@linux.vnet.ibm.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":1771873,"web_url":"http://patchwork.ozlabs.org/comment/1771873/","msgid":"<1f526c43-6967-e30c-25c7-3b079e0598d3@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-20T11:34:21","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","submitter":{"id":68297,"url":"http://patchwork.ozlabs.org/api/people/68297/","name":"Halil Pasic","email":"pasic@linux.vnet.ibm.com"},"content":"On 09/20/2017 10:06 AM, Cornelia Huck wrote:\n> On Tue, 19 Sep 2017 20:27:44 +0200\n> Halil Pasic <pasic@linux.vnet.ibm.com> wrote:\n> \n>> The architecture mandates the addresses to be  accessed on the first\n>> indirection level (that is, the data addresses without IDA, and the\n>> (M)IDAW addresses with (M)IDA) to be checked against an CCW format\n>> dependent limit maximum address.  If a violation is detected, the storage\n>> access is not to be performed and a channel program check needs to be\n>> generated. As of today, we fail to do this check.\n>>\n>> Let us stick even closer to the architecture specification.\n>>\n>> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n>> ---\n>>  hw/s390x/css.c         | 10 ++++++++++\n>>  include/hw/s390x/css.h |  1 +\n>>  2 files changed, 11 insertions(+)\n>>\n>> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n>> index 6b0cd8861b..2d37a9ddde 100644\n>> --- a/hw/s390x/css.c\n>> +++ b/hw/s390x/css.c\n>> @@ -795,6 +795,11 @@ static inline int cds_check_len(CcwDataStream *cds, int len)\n>>      return cds->flags & CDS_F_STREAM_BROKEN ? -EINVAL : len;\n>>  }\n>>  \n>> +static inline bool cds_ccw_addrs_ok(hwaddr addr, int len, bool ccw_fmt1)\n> \n> cds_cda_limit_ok?\n> \n\nI use cda to point to the 2 level in case of IDA. This is about\nlevel 1 (addressed by the ccw directly). That's why I used ccw_addrs\nbut if you think cds_cda_limit_ok is better I can live with that.\n\nWe could also think about renaming cds->cda. Btw what does cda stand\nfor (channel data address is my guess)?\n\nRegards,\nHalil\n\n>> +{\n>> +    return (addr + len) < (ccw_fmt1 ? (1UL << 31) : (1UL << 24));\n>> +}\n>> +\n>>  static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,\n>>                                    CcwDataStreamOp op)\n>>  {\n> \n> Looks good.\n>","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 3xy1Pb1R6Nz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 23:51:47 +1000 (AEST)","from localhost ([::1]:48207 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 1dufPl-0006UO-8E\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 09:51:45 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:45910)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pasic@linux.vnet.ibm.com>) id 1duesY-0003tU-Bp\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:17:29 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pasic@linux.vnet.ibm.com>) id 1duesU-0001cS-D7\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:17:26 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:35740)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pasic@linux.vnet.ibm.com>)\n\tid 1duesU-0001c1-3f\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 09:17:22 -0400","from pps.filterd (m0098393.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8KBZ28B091960\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 07:35:08 -0400","from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d3n781a1g-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 07:35:07 -0400","from localhost\n\tby e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <pasic@linux.vnet.ibm.com>;\n\tWed, 20 Sep 2017 12:34:24 +0100","from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198)\n\tby e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tWed, 20 Sep 2017 12:34:22 +0100","from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com\n\t[9.149.105.61])\n\tby b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8KBYMCK17301652; Wed, 20 Sep 2017 11:34:22 GMT","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id B1F3511C04C;\n\tWed, 20 Sep 2017 12:30:24 +0100 (BST)","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 6647A11C04A;\n\tWed, 20 Sep 2017 12:30:24 +0100 (BST)","from oc3836556865.ibm.com (unknown [9.152.224.207])\n\tby d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tWed, 20 Sep 2017 12:30:24 +0100 (BST)"],"To":"Cornelia Huck <cohuck@redhat.com>","References":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>\n\t<20170920100640.79900c9f.cohuck@redhat.com>","From":"Halil Pasic <pasic@linux.vnet.ibm.com>","Date":"Wed, 20 Sep 2017 13:34:21 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920100640.79900c9f.cohuck@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","x-cbid":"17092011-0008-0000-0000-00000498A2DA","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092011-0009-0000-0000-00001E29D8E1","Message-Id":"<1f526c43-6967-e30c-25c7-3b079e0598d3@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-20_03:, , 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-1709200158","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 v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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\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":1771944,"web_url":"http://patchwork.ozlabs.org/comment/1771944/","msgid":"<20170920134358.568404ac.cohuck@redhat.com>","list_archive_url":null,"date":"2017-09-20T11:43:58","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","submitter":{"id":71914,"url":"http://patchwork.ozlabs.org/api/people/71914/","name":"Cornelia Huck","email":"cohuck@redhat.com"},"content":"On Wed, 20 Sep 2017 13:34:21 +0200\nHalil Pasic <pasic@linux.vnet.ibm.com> wrote:\n\n> On 09/20/2017 10:06 AM, Cornelia Huck wrote:\n> > On Tue, 19 Sep 2017 20:27:44 +0200\n> > Halil Pasic <pasic@linux.vnet.ibm.com> wrote:\n> >   \n> >> The architecture mandates the addresses to be  accessed on the first\n> >> indirection level (that is, the data addresses without IDA, and the\n> >> (M)IDAW addresses with (M)IDA) to be checked against an CCW format\n> >> dependent limit maximum address.  If a violation is detected, the storage\n> >> access is not to be performed and a channel program check needs to be\n> >> generated. As of today, we fail to do this check.\n> >>\n> >> Let us stick even closer to the architecture specification.\n> >>\n> >> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>\n> >> ---\n> >>  hw/s390x/css.c         | 10 ++++++++++\n> >>  include/hw/s390x/css.h |  1 +\n> >>  2 files changed, 11 insertions(+)\n> >>\n> >> diff --git a/hw/s390x/css.c b/hw/s390x/css.c\n> >> index 6b0cd8861b..2d37a9ddde 100644\n> >> --- a/hw/s390x/css.c\n> >> +++ b/hw/s390x/css.c\n> >> @@ -795,6 +795,11 @@ static inline int cds_check_len(CcwDataStream *cds, int len)\n> >>      return cds->flags & CDS_F_STREAM_BROKEN ? -EINVAL : len;\n> >>  }\n> >>  \n> >> +static inline bool cds_ccw_addrs_ok(hwaddr addr, int len, bool ccw_fmt1)  \n> > \n> > cds_cda_limit_ok?\n> >   \n> \n> I use cda to point to the 2 level in case of IDA. This is about\n> level 1 (addressed by the ccw directly). That's why I used ccw_addrs\n> but if you think cds_cda_limit_ok is better I can live with that.\n\nI don't care that much, tbh.\n\n> \n> We could also think about renaming cds->cda. Btw what does cda stand\n> for (channel data address is my guess)?\n\nYes, cda should stand for 'channel data address'. Its usage in cds->cda\nis probably the source of this minor confusion.\n\nBut, as said, I don't really care that much; so unless one of the other\nfolks has a strong opinion, feel free to leave as-is.","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>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=cohuck@redhat.com"],"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 3xy2hc6cz6z9s4q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 00:49:52 +1000 (AEST)","from localhost ([::1]:48597 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 1dugJy-0001jC-VY\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 10:49:51 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55359)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dufjB-0000Oo-2N\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <cohuck@redhat.com>) id 1dufj7-000475-22\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:49 -0400","from mx1.redhat.com ([209.132.183.28]:35508)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <cohuck@redhat.com>) id 1dufj6-00046h-Rf\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 10:11:44 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 4A30F1E2D7;\n\tWed, 20 Sep 2017 11:44:04 +0000 (UTC)","from gondolin (ovpn-117-98.ams2.redhat.com [10.36.117.98])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 632665D9CB;\n\tWed, 20 Sep 2017 11:44:02 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 4A30F1E2D7","Date":"Wed, 20 Sep 2017 13:43:58 +0200","From":"Cornelia Huck <cohuck@redhat.com>","To":"Halil Pasic <pasic@linux.vnet.ibm.com>","Message-ID":"<20170920134358.568404ac.cohuck@redhat.com>","In-Reply-To":"<1f526c43-6967-e30c-25c7-3b079e0598d3@linux.vnet.ibm.com>","References":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>\n\t<20170920100640.79900c9f.cohuck@redhat.com>\n\t<1f526c43-6967-e30c-25c7-3b079e0598d3@linux.vnet.ibm.com>","Organization":"Red Hat GmbH","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 20 Sep 2017 11:44:04 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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\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":1772041,"web_url":"http://patchwork.ozlabs.org/comment/1772041/","msgid":"<1254ddda-74a6-fa8e-5d7c-9ab995497a04@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-20T11:02:59","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","submitter":{"id":68297,"url":"http://patchwork.ozlabs.org/api/people/68297/","name":"Halil Pasic","email":"pasic@linux.vnet.ibm.com"},"content":"On 09/20/2017 10:25 AM, Cornelia Huck wrote:\n> On Wed, 20 Sep 2017 15:47:51 +0800\n> Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> wrote:\n> \n>> * Halil Pasic <pasic@linux.vnet.ibm.com> [2017-09-19 20:27:44 +0200]:\n> \n>>> @@ -828,7 +836,9 @@ void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb)\n>>>      g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW));\n>>>      cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2K ? CDS_F_I2K : 0) |\n>>>                   (orb->ctrl0 & ORB_CTRL0_MASK_C64 ? CDS_F_C64 : 0) |\n>>> +                 (orb->ctrl0 & ORB_CTRL0_MASK_FMT ? CDS_F_FMT : 0) |  \n>> This reminds me one more question:\n>> Calling ccw_dsteram_init() after copy_ccw_from_guest() may lead to a\n>> fmt-1 @ccw with an @orb that designates fmt-0 ccw. This sounds insane.\n> \n> That's just a consequence of us translating everything to format-1\n> ccws. A bit confusing, but no problem if we pay attention to the format\n> bit everywhere it makes a difference.\n> \n\nAgree.\n\nHalil","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 3xy4l029tzz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 02:22:04 +1000 (AEST)","from localhost ([::1]:49491 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 1duhlC-0000EB-6q\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 12:22:02 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:48011)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pasic@linux.vnet.ibm.com>) id 1dugqr-0002Pu-Fr\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 11:23:50 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pasic@linux.vnet.ibm.com>) id 1dugqm-0007xF-0k\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 11:23:49 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58930\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 <pasic@linux.vnet.ibm.com>)\n\tid 1dugql-0007wG-MK\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 11:23:43 -0400","from pps.filterd (m0098421.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8KAxPuY134697\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 07:03:04 -0400","from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d3phjtb45-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 07:03:03 -0400","from localhost\n\tby e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <pasic@linux.vnet.ibm.com>;\n\tWed, 20 Sep 2017 12:03:02 +0100","from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196)\n\tby e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tWed, 20 Sep 2017 12:03:00 +0100","from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com\n\t[9.149.105.61])\n\tby b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8KB2x4g16711870; Wed, 20 Sep 2017 11:02:59 GMT","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C761411C058;\n\tWed, 20 Sep 2017 11:59:01 +0100 (BST)","from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id A157911C04C;\n\tWed, 20 Sep 2017 11:59:01 +0100 (BST)","from oc3836556865.ibm.com (unknown [9.152.224.207])\n\tby d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tWed, 20 Sep 2017 11:59:01 +0100 (BST)"],"To":"Cornelia Huck <cohuck@redhat.com>,\n\tDong Jia Shi <bjsdjshi@linux.vnet.ibm.com>","References":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>\n\t<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>\n\t<20170920102537.6b329909.cohuck@redhat.com>","From":"Halil Pasic <pasic@linux.vnet.ibm.com>","Date":"Wed, 20 Sep 2017 13:02:59 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170920102537.6b329909.cohuck@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17092011-0012-0000-0000-0000057AAA31","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092011-0013-0000-0000-000018F3E241","Message-Id":"<1254ddda-74a6-fa8e-5d7c-9ab995497a04@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-20_03:, , 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-1709200149","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 v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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":"Pierre 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":1772333,"web_url":"http://patchwork.ozlabs.org/comment/1772333/","msgid":"<20170921003909.GK11080@bjsdjshi@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-21T00:39:09","subject":"Re: [Qemu-devel] [PATCH v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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-20 13:02:59 +0200]:\n\n> \n> \n> On 09/20/2017 10:25 AM, Cornelia Huck wrote:\n> > On Wed, 20 Sep 2017 15:47:51 +0800\n> > Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> wrote:\n> > \n> >> * Halil Pasic <pasic@linux.vnet.ibm.com> [2017-09-19 20:27:44 +0200]:\n> > \n> >>> @@ -828,7 +836,9 @@ void ccw_dstream_init(CcwDataStream *cds, CCW1 const *ccw, ORB const *orb)\n> >>>      g_assert(!(orb->ctrl1 & ORB_CTRL1_MASK_MIDAW));\n> >>>      cds->flags = (orb->ctrl0 & ORB_CTRL0_MASK_I2K ? CDS_F_I2K : 0) |\n> >>>                   (orb->ctrl0 & ORB_CTRL0_MASK_C64 ? CDS_F_C64 : 0) |\n> >>> +                 (orb->ctrl0 & ORB_CTRL0_MASK_FMT ? CDS_F_FMT : 0) |  \n> >> This reminds me one more question:\n> >> Calling ccw_dsteram_init() after copy_ccw_from_guest() may lead to a\n> >> fmt-1 @ccw with an @orb that designates fmt-0 ccw. This sounds insane.\n> > \n> > That's just a consequence of us translating everything to format-1\n> > ccws. A bit confusing, but no problem if we pay attention to the format\n> > bit everywhere it makes a difference.\n> > \n> \n> Agree.\nOk. I'm fine with this.\n\n> \n> Halil","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 3xyHnP4fGnz9sRm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 10:39:50 +1000 (AEST)","from localhost ([::1]:51234 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 1dupWs-0000Dd-Lg\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 20:39:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54451)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1dupWW-0000DF-7W\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:39:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bjsdjshi@linux.vnet.ibm.com>) id 1dupWT-0005DH-4h\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:39:24 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52964)\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 1dupWS-0005CV-Ru\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 20:39:21 -0400","from pps.filterd (m0098394.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv8L0dI1o095185\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 20:39:19 -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 2d3v9fdk43-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 20:39:18 -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\tWed, 20 Sep 2017 20:39:13 -0400","from b01cxnp23032.gho.pok.ibm.com (9.57.198.27)\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\tWed, 20 Sep 2017 20:39:12 -0400","from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com\n\t[9.57.199.110])\n\tby b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v8L0dBSw26935332; Thu, 21 Sep 2017 00:39:11 GMT","from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 11786AE034;\n\tWed, 20 Sep 2017 20:39:43 -0400 (EDT)","from localhost (unknown [9.115.112.23])\n\tby b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 3DEF3AE052;\n\tWed, 20 Sep 2017 20:39:42 -0400 (EDT)"],"Date":"Thu, 21 Sep 2017 08:39:09 +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":"<20170919182745.90280-1-pasic@linux.vnet.ibm.com>\n\t<20170919182745.90280-5-pasic@linux.vnet.ibm.com>\n\t<20170920074751.GI11080@bjsdjshi@linux.vnet.ibm.com>\n\t<20170920102537.6b329909.cohuck@redhat.com>\n\t<1254ddda-74a6-fa8e-5d7c-9ab995497a04@linux.vnet.ibm.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1254ddda-74a6-fa8e-5d7c-9ab995497a04@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":"17092100-0036-0000-0000-0000026DBF03","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007770; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000230; SDB=6.00919987; UDB=6.00462242;\n\tIPR=6.00700214; \n\tBA=6.00005599; 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.00017227;\n\tXFM=3.00000015; UTC=2017-09-21 00:39:12","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17092100-0037-0000-0000-000041D5DDFA","Message-Id":"<20170921003909.GK11080@bjsdjshi@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-20_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-1709210007","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 v3 4/5] 390x/css: introduce maximum data\n\taddress checking","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>"}}]