From nobody Fri Dec 19 04:08:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593690730; cv=none; d=zohomail.com; s=zohoarc; b=HUOuo35Rcxq6JLeT3+kLU3v9bjBkVPFMtYGXra0+5qkBochzU5ix2SOTUoGb6F0D1a7qUNcgwQHcz2f1qb/Fo0BY5nOD5VuXWFd+4W/Q6iTz++PxEOW36l1G+NjZA6ux32LiEBOP+9wQ/sVNep2rRgaHSuY1dVQMCZiIygzBIiY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593690730; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=915LyuhHjcogim0Nd0Ll1MPVCzYS2yCowM2sgNtXmXs=; b=RxC1CivWWwsvTKd9UpvMubCeBJnozLHqK0IJaWYXZQCkwYIFUbHvaTXfFwLh1mFHCgULSUernGs6mZHCSVLvpJwVBsbVXclvNngL+srgqR9eh4sqZoIwGZmYpuuTxdG7MLsK0gFXiSOypO/KIhtUlrRngOfet9lPXGjoj+qldy0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593690730337320.7679025236213; Thu, 2 Jul 2020 04:52:10 -0700 (PDT) Received: from localhost ([::1]:59338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqxl9-0000Yw-D7 for importer@patchew.org; Thu, 02 Jul 2020 07:52:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqxk1-0007D8-Md for qemu-devel@nongnu.org; Thu, 02 Jul 2020 07:50:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:39414 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqxjz-0007IE-C1 for qemu-devel@nongnu.org; Thu, 02 Jul 2020 07:50:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-272--fTkj-4iPdetPEP4a0OEGw-1; Thu, 02 Jul 2020 07:50:52 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC40D108C309; Thu, 2 Jul 2020 11:50:50 +0000 (UTC) Received: from thuth.com (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F87A610F2; Thu, 2 Jul 2020 11:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593690654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=915LyuhHjcogim0Nd0Ll1MPVCzYS2yCowM2sgNtXmXs=; b=Kl7F4sMwz0QYpQF9Kw9NEHS9sN14xXthPulLIn0El4tigYSeTOw4Uoy1AOGpogm7tr9O5R K+UbOuIW9fC9XVLl+ybb3x9KM3TMe3sdgMuH2OgJ4DibFswuq41aI1SkQKAC5E817Eh2WU I7eV9jKS5IVu4+prPsMF0mjhglXEfR4= X-MC-Unique: -fTkj-4iPdetPEP4a0OEGw-1 From: Thomas Huth To: Cornelia Huck , qemu-devel@nongnu.org Subject: [PULL SUBSYSTEM s390x 01/11] pc-bios: s390x: cio.c cleanup and compile fix Date: Thu, 2 Jul 2020 13:50:35 +0200 Message-Id: <20200702115045.6171-2-thuth@redhat.com> In-Reply-To: <20200702115045.6171-1-thuth@redhat.com> References: <20200702115045.6171-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=thuth@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/02 04:00:43 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , qemu-s390x@nongnu.org, Janosch Frank Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Janosch Frank Let's initialize the structs at the beginning to ease reading and also zeroing all other fields. This also makes the compiler stop complaining about sense_id_ccw.flags being ored into when it's not initialized. Signed-off-by: Janosch Frank Reviewed-by: Pierre Morel Reviewed-by: Thomas Huth Reviewed-by: David Hildenbrand Reviewed-by: Christian Borntraeger Reviewed-by: Cornelia Huck Message-Id: <20200624075226.92728-2-frankja@linux.ibm.com> Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/cio.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 339ec5fbe7..83ca27ab41 100644 --- a/pc-bios/s390-ccw/cio.c +++ b/pc-bios/s390-ccw/cio.c @@ -49,13 +49,13 @@ void enable_subchannel(SubChannelId schid) =20 uint16_t cu_type(SubChannelId schid) { - Ccw1 sense_id_ccw; SenseId sense_data; - - sense_id_ccw.cmd_code =3D CCW_CMD_SENSE_ID; - sense_id_ccw.cda =3D ptr2u32(&sense_data); - sense_id_ccw.count =3D sizeof(sense_data); - sense_id_ccw.flags |=3D CCW_FLAG_SLI; + Ccw1 sense_id_ccw =3D { + .cmd_code =3D CCW_CMD_SENSE_ID, + .flags =3D CCW_FLAG_SLI, + .count =3D sizeof(sense_data), + .cda =3D ptr2u32(&sense_data), + }; =20 if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { panic("Failed to run SenseID CCw\n"); @@ -67,13 +67,13 @@ uint16_t cu_type(SubChannelId schid) int basic_sense(SubChannelId schid, uint16_t cutype, void *sense_data, uint16_t data_size) { - Ccw1 senseCcw; + Ccw1 senseCcw =3D { + .cmd_code =3D CCW_CMD_BASIC_SENSE, + .count =3D data_size, + .cda =3D ptr2u32(sense_data), + }; Irb irb; =20 - senseCcw.cmd_code =3D CCW_CMD_BASIC_SENSE; - senseCcw.cda =3D ptr2u32(sense_data); - senseCcw.count =3D data_size; - return __do_cio(schid, ptr2u32(&senseCcw), CCW_FMT1, &irb); } =20 @@ -314,7 +314,17 @@ static void print_irb_err(Irb *irb) */ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *i= rb) { - CmdOrb orb =3D {}; + /* + * QEMU's CIO implementation requires prefetch and 64-bit idaws. We + * allow all paths. + */ + CmdOrb orb =3D { + .fmt =3D fmt, + .pfch =3D 1, + .c64 =3D 1, + .lpm =3D 0xFF, + .cpa =3D ccw_addr, + }; int rc; =20 IPL_assert(fmt =3D=3D 0 || fmt =3D=3D 1, "Invalid ccw format"); @@ -324,12 +334,6 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_a= ddr, int fmt, Irb *irb) IPL_assert(ccw_addr <=3D 0xFFFFFF - 8, "Invalid ccw address"); } =20 - orb.fmt =3D fmt; - orb.pfch =3D 1; /* QEMU's cio implementation requires prefetch */ - orb.c64 =3D 1; /* QEMU's cio implementation requires 64-bit idaws */ - orb.lpm =3D 0xFF; /* All paths allowed */ - orb.cpa =3D ccw_addr; - rc =3D ssch(schid, &orb); if (rc =3D=3D 1 || rc =3D=3D 2) { /* Subchannel status pending or busy. Eat status and ask for retry= . */ --=20 2.18.1