From patchwork Fri Sep 8 15:24:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Halil Pasic X-Patchwork-Id: 811648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xph3S0Cz8z9sCZ for ; Sat, 9 Sep 2017 01:25:40 +1000 (AEST) Received: from localhost ([::1]:45950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqLA2-0000c1-3l for incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 11:25:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqL9U-0000bD-Bp for qemu-devel@nongnu.org; Fri, 08 Sep 2017 11:25:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqL9P-0004p4-74 for qemu-devel@nongnu.org; Fri, 08 Sep 2017 11:25:04 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40354 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqL9P-0004oT-1I for qemu-devel@nongnu.org; Fri, 08 Sep 2017 11:24:59 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v88FNtf5005695 for ; Fri, 8 Sep 2017 11:24:56 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 2cuw50jhk5-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 08 Sep 2017 11:24:56 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Sep 2017 16:24:55 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 8 Sep 2017 16:24:53 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v88FOrlh8913078; Fri, 8 Sep 2017 15:24:53 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8FEEAE051; Fri, 8 Sep 2017 16:20:04 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A832DAE04D; Fri, 8 Sep 2017 16:20:04 +0100 (BST) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 8 Sep 2017 16:20:04 +0100 (BST) From: Halil Pasic To: Cornelia Huck Date: Fri, 8 Sep 2017 17:24:44 +0200 X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170908152446.14606-1-pasic@linux.vnet.ibm.com> References: <20170908152446.14606-1-pasic@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17090815-0016-0000-0000-000004EB96C0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17090815-0017-0000-0000-000028259E17 Message-Id: <20170908152446.14606-3-pasic@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-08_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709080231 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 2/4] s390x/css: fix NULL handling for CCW addresses 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: Dong Jia Shi , Halil Pasic , Pierre Morel , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Back then in the time of df1fe5bb49 ("s390: Virtual channel subsystem support.", 2013-01-24) -EIO used to map to a channel-program check (via the default label of the switch statement). Then 2dc95b4cac ("s390x/3270: 3270 data stream handling", 2016-04-01) came along and that changed dramatically. Let us roll back this undesired side effect, and go back to channel-program check. Signed-off-by: Halil Pasic Fixes: 2dc95b4cac "s390x/3270: 3270 data stream handling" --- I'm not sure 0 as CCW address it's strictly illegal. Yes 0 is an unlikely address for a CCW but I would appreciate a PoP reference clarifying this... Another reason to not use Unix/POSIX error codes like this. --- hw/s390x/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 09f6ba0310..a44d87ab3e 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -793,7 +793,7 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr, CCW1 ccw; if (!ccw_addr) { - return -EIO; + return -EINVAL; /* channel-program check */ } /* Check doubleword aligned and 31 or 24 (fmt 0) bit addressable. */ if (ccw_addr & (sch->ccw_fmt_1 ? 0x80000007 : 0xff000007)) {