From nobody Thu May 2 15:48:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501233858070571.5988263343912; Fri, 28 Jul 2017 02:24:18 -0700 (PDT) Received: from localhost ([::1]:47015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1VI-0000xn-Qe for importer@patchew.org; Fri, 28 Jul 2017 05:24:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1RP-0006Sm-8n for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db1RO-0006GZ-Gn for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38498) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db1RO-0006Eg-Bh for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BE9A192E2F; Fri, 28 Jul 2017 09:20:13 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 410637E2CE; Fri, 28 Jul 2017 09:20:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5BE9A192E2F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 28 Jul 2017 11:19:57 +0200 Message-Id: <20170728092000.19216-2-cohuck@redhat.com> In-Reply-To: <20170728092000.19216-1-cohuck@redhat.com> References: <20170728092000.19216-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 28 Jul 2017 09:20:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.10 1/4] target/s390x: fix pgm irq ilen for stsi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand The instruction is 4 bytes long. Signed-off-by: David Hildenbrand Message-Id: <20170721125609.11117-2-david@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- target/s390x/misc_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 44c5c401fb..d23ffcd890 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -192,7 +192,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, if ((r0 & STSI_LEVEL_MASK) <=3D STSI_LEVEL_3 && ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK))) { /* valid function code, invalid reserved bits */ - program_interrupt(env, PGM_SPECIFICATION, 2); + program_interrupt(env, PGM_SPECIFICATION, 4); } =20 sel1 =3D r0 & STSI_R0_SEL1_MASK; --=20 2.13.3 From nobody Thu May 2 15:48:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501234014638720.7406747983823; Fri, 28 Jul 2017 02:26:54 -0700 (PDT) Received: from localhost ([::1]:47026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1Xp-0003nM-48 for importer@patchew.org; Fri, 28 Jul 2017 05:26:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1RR-0006Wk-Dd for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db1RQ-0006Kb-Jc for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db1RQ-0006IV-D9 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62C7070372; Fri, 28 Jul 2017 09:20:15 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D657F756A7; Fri, 28 Jul 2017 09:20:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 62C7070372 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 28 Jul 2017 11:19:58 +0200 Message-Id: <20170728092000.19216-3-cohuck@redhat.com> In-Reply-To: <20170728092000.19216-1-cohuck@redhat.com> References: <20170728092000.19216-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Jul 2017 09:20:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.10 2/4] target/s390x: fix pgm irq ilen in translate_pages() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand 0 is certainly wrong. Let's use ILEN_AUTO. Signed-off-by: David Hildenbrand Message-Id: <20170721125609.11117-3-david@redhat.com> Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- target/s390x/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index a873dc48a0..1ad01584b4 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -440,7 +440,7 @@ static int translate_pages(S390CPU *cpu, vaddr addr, in= t nr_pages, } if (!address_space_access_valid(&address_space_memory, pages[i], TARGET_PAGE_SIZE, is_write)) { - program_interrupt(env, PGM_ADDRESSING, 0); + program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO); return -EFAULT; } addr +=3D TARGET_PAGE_SIZE; --=20 2.13.3 From nobody Thu May 2 15:48:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501233965168417.0045423390959; Fri, 28 Jul 2017 02:26:05 -0700 (PDT) Received: from localhost ([::1]:47024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1X1-00038z-T7 for importer@patchew.org; Fri, 28 Jul 2017 05:26:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1RY-0006e0-B5 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db1RU-0006PY-7c for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db1RU-0006P7-0Q for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF01A18310A; Fri, 28 Jul 2017 09:20:18 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0FFD5D9C9; Fri, 28 Jul 2017 09:20:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EF01A18310A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 28 Jul 2017 11:19:59 +0200 Message-Id: <20170728092000.19216-4-cohuck@redhat.com> In-Reply-To: <20170728092000.19216-1-cohuck@redhat.com> References: <20170728092000.19216-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 28 Jul 2017 09:20:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.10 3/4] s390x/css: check ccw address validity X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic According to the PoP channel command words (CCW) must be doubleword aligned and 31 bit addressable for format 1 and 24 bit addressable for format 0 CCWs. If the channel subsystem encounters a ccw address which does not satisfy this alignment requirement a program-check condition is recognised. The situation with 31 bit addressable is a bit more complicated: both the ORB and a format 1 CCW TIC hold the address of (the rest of) the channel program, that is the address of the next CCW in a word, and the PoP mandates that bit 0 of that word shall be zero -- or a program-check condition is to be recognized -- and does not belong to the field holding the ccw address. Since in code the corresponding fields span across the whole word (unlike in PoP where these are defined as 31 bit wide) we can check this by applying a mask. The 24 addressable case isn't affecting TIC because the address is composed of a halfword and a byte portion (no additional zero bit requirements) and just slightly complicates the ORB case where also bits 1-7 need to be zero. The same requirements (especially n-bit addressability) apply to the ccw addresses generated while chaining. Let's make our CSS implementation follow the AR more closely. Signed-off-by: Halil Pasic Message-Id: <20170727154842.23427-1-pasic@linux.vnet.ibm.com> Reviewed-by: Dong Jia Shi Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 6a42b95cee..177cbfc92d 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -795,6 +795,10 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw= _addr, if (!ccw_addr) { return -EIO; } + /* Check doubleword aligned and 31 or 24 (fmt 0) bit addressable. */ + if (ccw_addr & (sch->ccw_fmt_1 ? 0x80000007 : 0xff000007)) { + return -EINVAL; + } =20 /* Translate everything to format-1 ccws - the information is the same= . */ ccw =3D copy_ccw_from_guest(ccw_addr, sch->ccw_fmt_1); --=20 2.13.3 From nobody Thu May 2 15:48:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501234115007400.589084957405; Fri, 28 Jul 2017 02:28:35 -0700 (PDT) Received: from localhost ([::1]:47030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1ZR-0004r4-3B for importer@patchew.org; Fri, 28 Jul 2017 05:28:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1db1RY-0006e2-C6 for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1db1RW-0006UA-8r for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57292) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1db1RW-0006So-3k for qemu-devel@nongnu.org; Fri, 28 Jul 2017 05:20:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 180506F0C4; Fri, 28 Jul 2017 09:20:21 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7466A77ED0; Fri, 28 Jul 2017 09:20:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 180506F0C4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: peter.maydell@linaro.org Date: Fri, 28 Jul 2017 11:20:00 +0200 Message-Id: <20170728092000.19216-5-cohuck@redhat.com> In-Reply-To: <20170728092000.19216-1-cohuck@redhat.com> References: <20170728092000.19216-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Jul 2017 09:20:21 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.10 4/4] s390x/css: fix bits must be zero check for TIC X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, Cornelia Huck , qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, Halil Pasic , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Halil Pasic According to the PoP bit positions 0-3 and 8-32 of the format-1 CCW must contain zeros. Bits 0-3 are already covered by cmd_code validity checking, and bit 32 is covered by the CCW address checking. Bits 8-31 correspond to CCW1.flags and CCW1.count. Currently we only check for the absence of certain flags. Let's fix this. Signed-off-by: Halil Pasic Message-Id: <20170725224442.13383-3-pasic@linux.vnet.ibm.com> Reviewed-by: Dong Jia Shi [CH: tweaked comment] Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 177cbfc92d..1880b1a0ff 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -885,7 +885,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_= addr, ret =3D -EINVAL; break; } - if (ccw.flags & (CCW_FLAG_CC | CCW_FLAG_DC)) { + if (ccw.flags || ccw.count) { + /* We have already sanitized these if converted from fmt 0. */ ret =3D -EINVAL; break; } --=20 2.13.3