From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589459950; cv=none; d=zohomail.com; s=zohoarc; b=JxdFS/ABWOOqmMgCr1oCKRW8HZ+492ihn66+G+ByBJIzH2TcPBc8pD9ij9c97uOwpqKGEDFD04tqLwuXQUgdiwOsfUKS0aee4kXheaKG8J/6lCCZ3K+CyBUvh5LJNWspyBlTjHwwykMJrEGBxUl4oeYRIsbTqUQ7Jjmna6mlciE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589459950; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/MS6Q7aNYgCHZXSXnhPRBPv767Ql7xcvPqoF9e35T+g=; b=P6oU04KtUUtrkCjlez/SOhXHeZuGv2Rg+U23I5K5hEtyo0aN4gtQNHOqbMika+wpF+2UOp3IF+vBIzIg3T+X8R4NylOSXHt7TPDLnKsDNLsnhvd/yqfP4zWPzBvZtaHLYWUJYJ4Z3YIstabknsfGAD3G8S8HcWqTKwNpKJWYwlM= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589459950215849.1546599519922; Thu, 14 May 2020 05:39:10 -0700 (PDT) Received: from localhost ([::1]:37054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZD8m-0004x6-OO for importer@patchew.org; Thu, 14 May 2020 08:39:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7O-0003Dm-Mq; Thu, 14 May 2020 08:37:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7N-0006UU-CA; Thu, 14 May 2020 08:37:42 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECW3GX065832; Thu, 14 May 2020 08:37:39 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310syx24t7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:39 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECWo50072201; Thu, 14 May 2020 08:37:38 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 310syx24sd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:38 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZN5R007631; Thu, 14 May 2020 12:37:36 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 3100ubbn7s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:36 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECaM5b58720522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:36:22 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFA2BA4054; Thu, 14 May 2020 12:37:33 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DAD3A4060; Thu, 14 May 2020 12:37:33 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:33 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 1/9] pc-bios: s390x: cio.c cleanup and compile fix Date: Thu, 14 May 2020 08:37:21 -0400 Message-Id: <20200514123729.156283-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=1 spamscore=0 bulkscore=0 impostorscore=0 cotscore=-2147483648 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=602 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140109 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's initialize the structs at the beginning to ease reading and also zeroing all other fields. This also makes the compiler stop compalining about sense_id_ccw.flags being ored into when it's not initialized. Signed-off-by: Janosch Frank Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/cio.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 339ec5fbe7..63301ebb58 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, + .count =3D sizeof(sense_data), + .flags =3D CCW_FLAG_SLI, + .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,13 @@ 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 {}; + CmdOrb orb =3D { + .fmt =3D fmt, + .pfch =3D 1, /* QEMU's cio implementation requires prefetch */ + .c64 =3D 1, /* QEMU's cio implementation requires 64-bit idaws */ + .lpm =3D 0xFF, /* All paths allowed */ + .cpa =3D ccw_addr, + }; int rc; =20 IPL_assert(fmt =3D=3D 0 || fmt =3D=3D 1, "Invalid ccw format"); @@ -324,12 +330,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.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460275; cv=none; d=zohomail.com; s=zohoarc; b=WLUaK58kpoBQ+ovEJ7J2apMxRJoJt7eLUeko0bONId7TMU4/nEj6HmyAloq60b57yI5ZV+3VkatOQxVLLJnvxktZmt8tssLs21AlEl4Db6sTAughdUtrVDyto09NMxG9ccVxl616KMl9yfSFPZR5OI7x/bzn8XYe+ltHttlOjlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460275; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8pDnVacFhoPV3GCSfSvG1ekM+8TYa6zti+qdnuOuA0M=; b=EbM/D+tHD0NY7lo856rq48CgEHuxruoKM6N89xA1lCTFKswcgZCsdCyrMkE8e+KYwyPW0NAfTYu3uG26v7MBgyVILrwuWxeX0HHE7X8ErEYNSOV/wZ3Ni0GFcq0R89w8NchaPw0e9GZlA3NLI75IEgvre19Akuy0vbpZJEU6nQI= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460275179277.3813178120363; Thu, 14 May 2020 05:44:35 -0700 (PDT) Received: from localhost ([::1]:55674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDE1-0004g0-Mi for importer@patchew.org; Thu, 14 May 2020 08:44:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7T-0003Gd-DG; Thu, 14 May 2020 08:37:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7P-0006Uz-3C; Thu, 14 May 2020 08:37:47 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECX0VO019496; Thu, 14 May 2020 08:37:41 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tjp4929-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:41 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECZ96B026237; Thu, 14 May 2020 08:37:40 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tjp490d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:40 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZR05005337; Thu, 14 May 2020 12:37:37 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 3100ub1fj9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:37 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECaNax59507188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:36:23 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B548CA4064; Thu, 14 May 2020 12:37:34 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 227E4A4054; Thu, 14 May 2020 12:37:34 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:34 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 2/9] pc-bios: s390x: Consolidate timing functions into time.h Date: Thu, 14 May 2020 08:37:22 -0400 Message-Id: <20200514123729.156283-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=1 phishscore=0 adultscore=0 priorityscore=1501 cotscore=-2147483648 malwarescore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's consolidate timing related functions into one header. Signed-off-by: Janosch Frank --- pc-bios/s390-ccw/menu.c | 1 + pc-bios/s390-ccw/netmain.c | 15 +++---------- pc-bios/s390-ccw/s390-ccw.h | 18 ---------------- pc-bios/s390-ccw/time.h | 39 ++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/virtio-net.c | 1 + pc-bios/s390-ccw/virtio-scsi.c | 1 + pc-bios/s390-ccw/virtio.c | 18 +++------------- 7 files changed, 48 insertions(+), 45 deletions(-) create mode 100644 pc-bios/s390-ccw/time.h diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c index ce3815b201..7925c33248 100644 --- a/pc-bios/s390-ccw/menu.c +++ b/pc-bios/s390-ccw/menu.c @@ -12,6 +12,7 @@ #include "libc.h" #include "s390-ccw.h" #include "sclp.h" +#include "time.h" =20 #define KEYCODE_NO_INP '\0' #define KEYCODE_ESCAPE '\033' diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 309ffa30d9..73def8de4f 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -35,6 +35,7 @@ #include "s390-ccw.h" #include "cio.h" #include "virtio.h" +#include "time.h" =20 #define DEFAULT_BOOT_RETRIES 10 #define DEFAULT_TFTP_RETRIES 20 @@ -57,24 +58,14 @@ static SubChannelId net_schid =3D { .one =3D 1 }; static uint8_t mac[6]; static uint64_t dest_timer; =20 -static uint64_t get_timer_ms(void) -{ - uint64_t clk; - - asm volatile(" stck %0 " : : "Q"(clk) : "memory"); - - /* Bit 51 is incremented each microsecond */ - return (clk >> (63 - 51)) / 1000; -} - void set_timer(int val) { - dest_timer =3D get_timer_ms() + val; + dest_timer =3D get_time_ms() + val; } =20 int get_timer(void) { - return dest_timer - get_timer_ms(); + return dest_timer - get_time_ms(); } =20 int get_sec_ticks(void) diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index 21f27e7990..c5820e43ae 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -74,8 +74,6 @@ unsigned long virtio_load_direct(ulong rec_list1, ulong r= ec_list2, bool virtio_is_supported(SubChannelId schid); void virtio_blk_setup_device(SubChannelId schid); int virtio_read(ulong sector, void *load_addr); -u64 get_clock(void); -ulong get_second(void); =20 /* bootmap.c */ void zipl_load(void); @@ -144,24 +142,8 @@ static inline void debug_print_addr(const char *desc, = void *p) #define KVM_S390_VIRTIO_SET_STATUS 2 #define KVM_S390_VIRTIO_CCW_NOTIFY 3 =20 -static inline void yield(void) -{ - asm volatile ("diag 0,0,0x44" - : : - : "memory", "cc"); -} - #define MAX_SECTOR_SIZE 4096 =20 -static inline void sleep(unsigned int seconds) -{ - ulong target =3D get_second() + seconds; - - while (get_second() < target) { - yield(); - } -} - static inline void IPL_assert(bool term, const char *message) { if (!term) { diff --git a/pc-bios/s390-ccw/time.h b/pc-bios/s390-ccw/time.h new file mode 100644 index 0000000000..899de83ae7 --- /dev/null +++ b/pc-bios/s390-ccw/time.h @@ -0,0 +1,39 @@ +#ifndef TIME_H +#define TIME_H + +static inline u64 get_clock(void) +{ + u64 r; + + asm volatile("stck %0" : "=3DQ" (r) : : "cc"); + return r; +} + +static inline u64 get_time_ms(void) +{ + /* Bit 51 is incremented each microsecond */ + return (get_clock() >> 12) / 1000; +} + +static inline u64 get_time_seconds(void) +{ + return (get_time_ms()) / 1000; +} + +static inline void yield(void) +{ + asm volatile ("diag 0,0,0x44" + : : + : "memory", "cc"); +} + +static inline void sleep(unsigned int seconds) +{ + ulong target =3D get_time_seconds() + seconds; + + while (get_time_seconds() < target) { + yield(); + } +} + +#endif diff --git a/pc-bios/s390-ccw/virtio-net.c b/pc-bios/s390-ccw/virtio-net.c index ff7f4dad25..4de03728bb 100644 --- a/pc-bios/s390-ccw/virtio-net.c +++ b/pc-bios/s390-ccw/virtio-net.c @@ -19,6 +19,7 @@ #include #include "s390-ccw.h" #include "virtio.h" +#include "time.h" =20 #ifndef DEBUG_VIRTIO_NET #define DEBUG_VIRTIO_NET 0 diff --git a/pc-bios/s390-ccw/virtio-scsi.c b/pc-bios/s390-ccw/virtio-scsi.c index 4fe4b9d261..0620651da8 100644 --- a/pc-bios/s390-ccw/virtio-scsi.c +++ b/pc-bios/s390-ccw/virtio-scsi.c @@ -14,6 +14,7 @@ #include "virtio.h" #include "scsi.h" #include "virtio-scsi.h" +#include "time.h" =20 static ScsiDevice default_scsi_device; static VirtioScsiCmdReq req; diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c index fb40ca9828..43717b83d7 100644 --- a/pc-bios/s390-ccw/virtio.c +++ b/pc-bios/s390-ccw/virtio.c @@ -15,6 +15,7 @@ #include "virtio-scsi.h" #include "bswap.h" #include "helper.h" +#include "time.h" =20 #define VRING_WAIT_REPLY_TIMEOUT 30 =20 @@ -157,19 +158,6 @@ void vring_send_buf(VRing *vr, void *p, int len, int f= lags) } } =20 -u64 get_clock(void) -{ - u64 r; - - asm volatile("stck %0" : "=3DQ" (r) : : "cc"); - return r; -} - -ulong get_second(void) -{ - return (get_clock() >> 12) / 1000000; -} - int vr_poll(VRing *vr) { if (vr->used->idx =3D=3D vr->used_idx) { @@ -194,7 +182,7 @@ int vr_poll(VRing *vr) */ int vring_wait_reply(void) { - ulong target_second =3D get_second() + vdev.wait_reply_timeout; + ulong target_second =3D get_time_seconds() + vdev.wait_reply_timeout; =20 /* Wait for any queue to be updated by the host */ do { @@ -207,7 +195,7 @@ int vring_wait_reply(void) if (r) { return 0; } - } while (!vdev.wait_reply_timeout || (get_second() < target_second)); + } while (!vdev.wait_reply_timeout || (get_time_seconds() < target_seco= nd)); =20 return 1; } --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460091; cv=none; d=zohomail.com; s=zohoarc; b=IoPQIUodtnHN/BCAyYBncJ9Decm1w5qC0Eqpvrvoy4oa0/8+pU2d94vGykAg807aZo7KsNG6ZU0d/kMcVlrrvwlMVaV2MjA5lrsXHk4Su8I/oAzr+X8oM4tCP+lf2Twe3ac1HTOYSEdqTdGpPN4f3iyvQ+gW5GiagGT/wc5Dbe8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460091; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ze8PsMLDbzYQuRTmH3snZI96ZOiI7L9yJ4Q5ttanhvQ=; b=f+3O3rXWuXeLLjgdD209bD1/MeKOfOmg2ZvPs/RslAJFOXvi0gWLI1KBVHTiPNVexML/7chamvcC4zSTGorJ7qrjT7p0BwqPo5jq9vWq3PvVRz/9W9i5ySmjyy2Tlf83+nmhbHgAnt+CWyZyqby0Vao7zK5Fx16hE4JxEt482bo= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460091207304.25925005943304; Thu, 14 May 2020 05:41:31 -0700 (PDT) Received: from localhost ([::1]:45652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDB3-0000Dr-QQ for importer@patchew.org; Thu, 14 May 2020 08:41:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7Q-0003Dx-Bf; Thu, 14 May 2020 08:37:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:30816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7O-0006Ud-Oh; Thu, 14 May 2020 08:37:44 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECZRKa114355; Thu, 14 May 2020 08:37:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tcmuydw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:40 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECZnib116171; Thu, 14 May 2020 08:37:40 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tcmuydd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:39 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZN5S007631; Thu, 14 May 2020 12:37:37 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3100ubbn7u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:37 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbZhp4522408 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:35 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78BC2A405C; Thu, 14 May 2020 12:37:35 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB087A405B; Thu, 14 May 2020 12:37:34 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:34 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 3/9] pc-bios: s390x: Get rid of magic offsets into the lowcore Date: Thu, 14 May 2020 08:37:23 -0400 Message-Id: <20200514123729.156283-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=674 priorityscore=1501 suspectscore=1 phishscore=0 clxscore=1015 impostorscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" If we have a lowcore struct that has members for offsets that we want to touch, why not use it? Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand --- pc-bios/s390-ccw/cio.h | 17 +++++++++++------ pc-bios/s390-ccw/main.c | 8 +++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h index aaa432dedd..1ce5344b85 100644 --- a/pc-bios/s390-ccw/cio.h +++ b/pc-bios/s390-ccw/cio.h @@ -122,12 +122,17 @@ typedef struct schib { } __attribute__ ((packed, aligned(4))) Schib; =20 typedef struct subchannel_id { - __u32 cssid:8; - __u32:4; - __u32 m:1; - __u32 ssid:2; - __u32 one:1; - __u32 sch_no:16; + union { + struct { + __u16 cssid:8; + __u16 reserved:4; + __u16 m:1; + __u16 ssid:2; + __u16 one:1; + }; + __u16 sch_id; + }; + __u16 sch_no; } __attribute__ ((packed, aligned(4))) SubChannelId; =20 struct chsc_header { diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 4e65b411e1..8b912454c9 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -36,11 +36,9 @@ LowCore *lowcore; /* Yes, this *is* a pointer to address= 0 */ */ void write_subsystem_identification(void) { - SubChannelId *schid =3D (SubChannelId *) 184; - uint32_t *zeroes =3D (uint32_t *) 188; - - *schid =3D blk_schid; - *zeroes =3D 0; + lowcore->subchannel_id =3D blk_schid.sch_id; + lowcore->subchannel_nr =3D blk_schid.sch_no; + lowcore->io_int_parm =3D 0; } =20 void write_iplb_location(void) --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589459952; cv=none; d=zohomail.com; s=zohoarc; b=hnTvJw9PmQ0dFfMSmHsv5IAdpfANE/KMvXof3K7fuNr4IjSy7K3ER/YWX927yQ/JYg6Kv8bhv/sUdn9LpVHW3bKbQXU/RTrh3A/s3rZeogip4wh0kFDKDDyTgfSEb5JjQbgbLGnn28xGahF4UkXYpuDpF89Ffftv8bezyViuaWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589459952; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=i7IgatFr7MRnM4RXZ/qltE2uyskCBlYLePp9baV38j0=; b=YvNxHRSODwa8CRlAPnNVVrVAP0l06OBc8ZhehejHR0qz5i9310UAC3anmO4t07MJzuMozzMv6Q7Z3/cgxx5Odp0j5grvChREYhYr5pPS7FEVXSYsFo/+Yvl8WqrnpUXiNJJThuAobuRi6nXRHqgTjT+i79UzPXk8fR4sbFjZuZA= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589459952398624.9789317098428; Thu, 14 May 2020 05:39:12 -0700 (PDT) Received: from localhost ([::1]:37222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZD8p-00051Q-1A for importer@patchew.org; Thu, 14 May 2020 08:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7P-0003Du-Gy; Thu, 14 May 2020 08:37:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:64590 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7O-0006Ui-Mf; Thu, 14 May 2020 08:37:43 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECX8mh109791; Thu, 14 May 2020 08:37:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 310uautqsa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:40 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECXba1113240; Thu, 14 May 2020 08:37:40 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 310uautqrf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:40 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZPuj011979; Thu, 14 May 2020 12:37:38 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04ams.nl.ibm.com with ESMTP id 3100ub3mqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:38 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbaLv60883168 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:36 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D483A405F; Thu, 14 May 2020 12:37:36 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F545A405B; Thu, 14 May 2020 12:37:35 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:35 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 4/9] pc-bios: s390x: Rename and use PSW_MASK_ZMODE constant Date: Thu, 14 May 2020 08:37:24 -0400 Message-Id: <20200514123729.156283-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 cotscore=-2147483648 mlxscore=0 phishscore=0 suspectscore=1 lowpriorityscore=0 malwarescore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140109 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=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 08:37:37 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" ZMODE has a lot of ambiguity with the ESAME architecture mode, but is actually 64 bit addressing. Signed-off-by: Janosch Frank Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand --- pc-bios/s390-ccw/dasd-ipl.c | 3 +-- pc-bios/s390-ccw/s390-arch.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 0fc879bb8e..b932531e6f 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -229,7 +229,6 @@ void dasd_ipl(SubChannelId schid, uint16_t cutype) run_ipl2(schid, cutype, ipl2_addr); =20 /* Transfer control to the guest operating system */ - pswl->mask |=3D PSW_MASK_EAMODE; /* Force z-mode */ - pswl->addr |=3D PSW_MASK_BAMODE; /* ... */ + pswl->mask |=3D PSW_MASK_64; /* Force 64 bit addressing */ jump_to_low_kernel(); } diff --git a/pc-bios/s390-ccw/s390-arch.h b/pc-bios/s390-ccw/s390-arch.h index 5f36361c02..73852029d4 100644 --- a/pc-bios/s390-ccw/s390-arch.h +++ b/pc-bios/s390-ccw/s390-arch.h @@ -29,7 +29,7 @@ _Static_assert(sizeof(struct PSWLegacy) =3D=3D 8, "PSWLeg= acy size incorrect"); #define PSW_MASK_WAIT 0x0002000000000000ULL #define PSW_MASK_EAMODE 0x0000000100000000ULL #define PSW_MASK_BAMODE 0x0000000080000000ULL -#define PSW_MASK_ZMODE (PSW_MASK_EAMODE | PSW_MASK_BAMODE) +#define PSW_MASK_64 (PSW_MASK_EAMODE | PSW_MASK_BAMODE) =20 /* Low core mapping */ typedef struct LowCore { --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589459952; cv=none; d=zohomail.com; s=zohoarc; b=RXjCawDHBP/dNaDH3bzajEvWEpTirH8s6r3Zr9SJTPYvWgNRgkijLmsqh3sZoYC1QRx2cfsEZ96Od5/oqPgH70tmOO4QZECYFg98D0GAPfMubASW73AyMfwbq38RaRufv2Qh3JF+m0S8iFaomlJuNj9NQxKZdOto+h290ssDrd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589459952; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a6bBDagBEE5GQ1WvRlULF3HAs9qusb3fN4EAGM5h0KA=; b=Cn6tZRuwfhLRFzlGhRXZLqCCuzz0dzzEA720AKccuV/iZqUZYpCYw9+QpK4DgCGs3t2vyQKQL4p+xWWwe0r4C6PbcbLabeisj5AQgzEP7V906fEx//0W5kontGrELAMNtw9VofEeG12q8RoWb1SnYnn9JuafUyC4D9TD5S24PKc= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589459952659401.87402297315566; Thu, 14 May 2020 05:39:12 -0700 (PDT) Received: from localhost ([::1]:37324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZD8p-00053k-8E for importer@patchew.org; Thu, 14 May 2020 08:39:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7R-0003EQ-Tw; Thu, 14 May 2020 08:37:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7Q-0006VI-BO; Thu, 14 May 2020 08:37:45 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECWwfk019261; Thu, 14 May 2020 08:37:43 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tjp4931-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:42 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECXBPE020255; Thu, 14 May 2020 08:37:42 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 310tjp491n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:42 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZQda011448; Thu, 14 May 2020 12:37:39 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3100ubhg18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:39 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbbEI60489910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:37 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0256AA405B; Thu, 14 May 2020 12:37:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6444DA4054; Thu, 14 May 2020 12:37:36 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:36 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 5/9] pc-bios: s390x: Use PSW masks where possible Date: Thu, 14 May 2020 08:37:25 -0400 Message-Id: <20200514123729.156283-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=1 phishscore=0 adultscore=0 priorityscore=1501 cotscore=-2147483648 malwarescore=0 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's move some of the PSW mask defines into s390-arch.h and use them in jump2ipl.c Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand --- pc-bios/s390-ccw/jump2ipl.c | 10 ++++------ pc-bios/s390-ccw/s390-arch.h | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index 4eba2510b0..767012bf0c 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -8,12 +8,10 @@ =20 #include "libc.h" #include "s390-ccw.h" +#include "s390-arch.h" =20 #define KERN_IMAGE_START 0x010000UL -#define PSW_MASK_64 0x0000000100000000ULL -#define PSW_MASK_32 0x0000000080000000ULL -#define PSW_MASK_SHORTPSW 0x0008000000000000ULL -#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_32 | PSW_MASK_64) +#define RESET_PSW_MASK (PSW_MASK_SHORTPSW | PSW_MASK_64) =20 typedef struct ResetInfo { uint64_t ipl_psw; @@ -54,7 +52,7 @@ void jump_to_IPL_code(uint64_t address) =20 current->ipl_psw =3D (uint64_t) &jump_to_IPL_2; current->ipl_psw |=3D RESET_PSW_MASK; - current->ipl_continue =3D address & 0x7fffffff; + current->ipl_continue =3D address & PSW_MASK_SHORT_ADDR; =20 debug_print_int("set IPL addr to", current->ipl_continue); =20 @@ -86,7 +84,7 @@ void jump_to_low_kernel(void) =20 /* Trying to get PSW at zero address */ if (*((uint64_t *)0) & RESET_PSW_MASK) { - jump_to_IPL_code((*((uint64_t *)0)) & 0x7fffffff); + jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR); } =20 /* No other option left, so use the Linux kernel start address */ diff --git a/pc-bios/s390-ccw/s390-arch.h b/pc-bios/s390-ccw/s390-arch.h index 73852029d4..6da44d4436 100644 --- a/pc-bios/s390-ccw/s390-arch.h +++ b/pc-bios/s390-ccw/s390-arch.h @@ -26,9 +26,11 @@ _Static_assert(sizeof(struct PSWLegacy) =3D=3D 8, "PSWLe= gacy size incorrect"); =20 /* s390 psw bit masks */ #define PSW_MASK_IOINT 0x0200000000000000ULL +#define PSW_MASK_SHORTPSW 0x0008000000000000ULL #define PSW_MASK_WAIT 0x0002000000000000ULL #define PSW_MASK_EAMODE 0x0000000100000000ULL #define PSW_MASK_BAMODE 0x0000000080000000ULL +#define PSW_MASK_SHORT_ADDR 0x000000007fffffffULL #define PSW_MASK_64 (PSW_MASK_EAMODE | PSW_MASK_BAMODE) =20 /* Low core mapping */ --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460098; cv=none; d=zohomail.com; s=zohoarc; b=h0yZ8VscoawF3TGN0FZz50Wyol3Mqot4SGogMwk0JfOqE4HWZ7sUSsICJPlj6zIcjsI7Hlm9bTDN1ycTQQIhdxPZcGVOeLy36M1VqhFHlZjr19QX5epdc7uBml+nAb4/J9qXe8Xo4uvplhkgYfmDxL8HltkNFrDSRHDUhoYQlcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460098; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3kyloe6Xz1vbVPwmvBRCzRllm9gIW4D/ZeFx6hsYEZM=; b=QB2wAG2FmH33kLNfgrFcCX6gjrs0Pcar3/VaC6C9rUKTRVJI4rPYREE+Uv2sgWCb3b+rrFdqM5dTbTD0yVFYpF+8smmCca3ShpSYHn2/u8eg8xKjIZXVAPewwWxHTW9UF5tLp6OtChd1HTIeZtotbDZ7Xmdpmgx7huJwATQDALY= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460098721392.99598258820436; Thu, 14 May 2020 05:41:38 -0700 (PDT) Received: from localhost ([::1]:45952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDBB-0000LX-FW for importer@patchew.org; Thu, 14 May 2020 08:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7S-0003EU-99; Thu, 14 May 2020 08:37:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7Q-0006VO-UF; Thu, 14 May 2020 08:37:45 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECX2Su129286; Thu, 14 May 2020 08:37:43 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310ub02pu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:43 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECXCJ3130680; Thu, 14 May 2020 08:37:43 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 310ub02ps8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:42 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZNHB005332; Thu, 14 May 2020 12:37:40 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03fra.de.ibm.com with ESMTP id 3100ub1fjb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:40 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbbOv20840536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:37 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B117FA405C; Thu, 14 May 2020 12:37:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29106A4054; Thu, 14 May 2020 12:37:37 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:37 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 6/9] pc-bios: s390x: Move panic() into header and add infinite loop Date: Thu, 14 May 2020 08:37:26 -0400 Message-Id: <20200514123729.156283-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=1 lowpriorityscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 mlxlogscore=999 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" panic() was defined for the ccw and net bios, i.e. twice, so it's cleaner to rather put it into the header. Also let's add an infinite loop into the assembly of disabled_wait() so the caller doesn't need to take care of it. Signed-off-by: Janosch Frank Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/main.c | 7 ------- pc-bios/s390-ccw/netmain.c | 8 -------- pc-bios/s390-ccw/s390-ccw.h | 9 +++++++-- pc-bios/s390-ccw/start.S | 5 +++-- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 8b912454c9..146a50760b 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -46,13 +46,6 @@ void write_iplb_location(void) lowcore->ptr_iplb =3D ptr2u32(&iplb); } =20 -void panic(const char *string) -{ - sclp_print(string); - disabled_wait(); - while (1) { } -} - unsigned int get_loadparm_index(void) { return atoui(loadparm_str); diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 73def8de4f..ef7ce1e01d 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -439,14 +439,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_= ip) return rc; } =20 -void panic(const char *string) -{ - sclp_print(string); - for (;;) { - disabled_wait(); - } -} - void write_subsystem_identification(void) { SubChannelId *schid =3D (SubChannelId *) 184; diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index c5820e43ae..36b884cced 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -50,12 +50,11 @@ typedef unsigned long long __u64; #include "iplb.h" =20 /* start.s */ -void disabled_wait(void); +void disabled_wait(void) __attribute__ ((__noreturn__)); void consume_sclp_int(void); void consume_io_int(void); =20 /* main.c */ -void panic(const char *string); void write_subsystem_identification(void); void write_iplb_location(void); extern char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); @@ -91,6 +90,12 @@ bool menu_is_enabled_enum(void); =20 #define MAX_BOOT_ENTRIES 31 =20 +static inline void panic(const char *string) +{ + sclp_print(string); + disabled_wait(); +} + static inline void fill_hex(char *out, unsigned char val) { const char hex[] =3D "0123456789abcdef"; diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index aa8fceb19d..35be141d8d 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/start.S @@ -47,8 +47,9 @@ memsetxc: */ .globl disabled_wait disabled_wait: - larl %r1,disabled_wait_psw - lpswe 0(%r1) + larl %r1,disabled_wait_psw + lpswe 0(%r1) +1: j 1b =20 =20 /* --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460236; cv=none; d=zohomail.com; s=zohoarc; b=b8cqN7MJKJNElW4pvEAjFFs5Z8SVAn7IXMNCqCrDhMyNIWcoaqZNscr0mtGCLmwtVm/OvbhaxI4jKicVR6FW69DRycpx9FRO52HxbMA+3jb/4bNSe+wo/zMwzcdamZVJDGl18Zv+9/nZRPiAwTtPxEJpU4VWuH+p5ElaH3Doack= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460236; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I4ZyVSL0D6cpSsyTYtTVsDnaKXXj6L8jNcNRuxt7IgY=; b=JY4nWKibeWrKJvvDArHL6I9/sz1D1LxhSMH3bXniJKeWd/GuNXFUMz73H+PiPPGABEKLZfsEFBEs2Z7EVFz/89wqvSj51feUUTJJ//kSablN3yVw5aPDtER0smnZGASNQmkFl9aOmVPzMXmi6+8FFK0jQ725Q7UZUZkkjlhkKfo= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460236201218.5163529509956; Thu, 14 May 2020 05:43:56 -0700 (PDT) Received: from localhost ([::1]:52544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDDO-0003Od-Pf for importer@patchew.org; Thu, 14 May 2020 08:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7S-0003EV-HG; Thu, 14 May 2020 08:37:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7R-0006VV-Fg; Thu, 14 May 2020 08:37:46 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECXRtA171225; Thu, 14 May 2020 08:37:44 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31016tj2ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:43 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECY11J173238; Thu, 14 May 2020 08:37:43 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 31016tj2mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:43 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECaMnK008513; Thu, 14 May 2020 12:37:41 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma02fra.de.ibm.com with ESMTP id 3100ub9ghx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:40 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbceF59048056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:38 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 89133A4060; Thu, 14 May 2020 12:37:38 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1A2CA405B; Thu, 14 May 2020 12:37:37 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:37 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 7/9] pc-bios: s390x: Use ebcdic2ascii table Date: Thu, 14 May 2020 08:37:27 -0400 Message-Id: <20200514123729.156283-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 adultscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 cotscore=-2147483648 impostorscore=0 phishscore=0 suspectscore=1 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Why should we do conversion of a ebcdic value if we have a handy table where we coul look up the ascii value instead? Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/bootmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index d13b7cbd15..97205674e5 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -328,9 +328,7 @@ static void print_eckd_ldl_msg(ECKD_IPL_mode_t mode) msg[0] =3D '2'; break; default: - msg[0] =3D vlbl->LDL_version; - msg[0] &=3D 0x0f; /* convert EBCDIC */ - msg[0] |=3D 0x30; /* to ASCII (digit) */ + msg[0] =3D ebc2asc[vlbl->LDL_version]; msg[1] =3D '?'; break; } --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460337; cv=none; d=zohomail.com; s=zohoarc; b=CW1j2o1BmMMcNl5E3uepJH5Y5bDQkIzPcqHlAOA4Y2eRARu2reUN3WU8pi2Rv8WxUz7tMzbv6OWsg0B/f/DrnfaUGR/r7mGCkSDm62BLYn1s8PKt4BOLA8f6t99aj7iGRnL9QWFWPXbLuS84PqywjYv3aX4bzSgQMR5JiORRLQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460337; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=y0XlvB570aLhKXhOWN4hKUCT3xEKJm4QivSCCn1b4NM=; b=Nchs8tHqz9xLr6vb9iChRgsMXXmYN1+pFeKJeVMkDRX7JUjfsdKFED6E7Q4GdEXB3BSYBtUirwMgkxldBh+hMkzuW+11aLrS/o3Ub+9CxoJep6WUXPdnet6ZZ+ZicJe3paT8Cu8EAKRJQTDDG5kbZjLvMaBuUwnPQnnsxhlgV8Q= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460337408123.83835507353137; Thu, 14 May 2020 05:45:37 -0700 (PDT) Received: from localhost ([::1]:32852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDF1-0006uS-Lp for importer@patchew.org; Thu, 14 May 2020 08:45:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7T-0003Fq-2K; Thu, 14 May 2020 08:37:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:24606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7S-0006Vh-4J; Thu, 14 May 2020 08:37:46 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECX1cV129248; Thu, 14 May 2020 08:37:44 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310ub02pue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:44 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECX7ri129909; Thu, 14 May 2020 08:37:44 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 310ub02pt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:43 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZMAZ011971; Thu, 14 May 2020 12:37:41 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 3100ub3mqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:41 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbdGA57868304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:39 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CF39A4065; Thu, 14 May 2020 12:37:39 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF9A1A4060; Thu, 14 May 2020 12:37:38 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:38 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 8/9] pc-bios: s390x: Replace 0x00 with 0x0 or 0 Date: Thu, 14 May 2020 08:37:28 -0400 Message-Id: <20200514123729.156283-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=1 lowpriorityscore=0 spamscore=0 clxscore=1015 cotscore=-2147483648 mlxlogscore=513 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140112 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 0x00 looks odd, time to replace it with 0 or 0x0 (for pointers). Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/dasd-ipl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index b932531e6f..764ee89e92 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -98,18 +98,18 @@ static int run_dynamic_ccw_program(SubChannelId schid, = uint16_t cutype, =20 static void make_readipl(void) { - Ccw0 *ccwIplRead =3D (Ccw0 *)0x00; + Ccw0 *ccwIplRead =3D (Ccw0 *)0x0; =20 /* Create Read IPL ccw at address 0 */ ccwIplRead->cmd_code =3D CCW_CMD_READ_IPL; - ccwIplRead->cda =3D 0x00; /* Read into address 0x00 in main memory */ + ccwIplRead->cda =3D 0x0; /* Read into address 0x00 in main memory */ ccwIplRead->chain =3D 0; /* Chain flag */ ccwIplRead->count =3D 0x18; /* Read 0x18 bytes of data */ } =20 static void run_readipl(SubChannelId schid, uint16_t cutype) { - if (do_cio(schid, cutype, 0x00, CCW_FMT0)) { + if (do_cio(schid, cutype, 0x0, CCW_FMT0)) { panic("dasd-ipl: Failed to run Read IPL channel program\n"); } } @@ -133,10 +133,10 @@ static void check_ipl2(uint32_t ipl2_addr) { Ccw0 *ccw =3D u32toptr(ipl2_addr); =20 - if (ipl2_addr =3D=3D 0x00) { + if (ipl2_addr =3D=3D 0) { panic("IPL2 address invalid. Is this disk really bootable?\n"); } - if (ccw->cmd_code =3D=3D 0x00) { + if (ccw->cmd_code =3D=3D 0) { panic("IPL2 ccw data invalid. Is this disk really bootable?\n"); } } @@ -161,7 +161,7 @@ static void ipl1_fixup(void) memcpy(ccwRead, (void *)0x08, 16); =20 /* Disable chaining so we don't TIC to IPL2 channel program */ - ccwRead->chain =3D 0x00; + ccwRead->chain =3D 0; =20 ccwSeek->cmd_code =3D CCW_CMD_DASD_SEEK; ccwSeek->cda =3D ptr2u32(seekData); @@ -206,7 +206,7 @@ static void run_ipl2(SubChannelId schid, uint16_t cutyp= e, uint32_t addr) */ void dasd_ipl(SubChannelId schid, uint16_t cutype) { - PSWLegacy *pswl =3D (PSWLegacy *) 0x00; + PSWLegacy *pswl =3D (PSWLegacy *) 0x0; uint32_t ipl2_addr; =20 /* Construct Read IPL CCW and run it to read IPL1 from boot disk */ --=20 2.25.1 From nobody Fri May 17 04:59:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589460236; cv=none; d=zohomail.com; s=zohoarc; b=LJ9PM71vh4HNXI6Ba0LCZrROS/TDIzS7/3aWf9WcOIVPuWd7cw77eobXrtTKG4DOhmacZGwXJu4bC18SXBzpLrge8Ahl/JWqRz/MwL3OZ1ccNCQlL3JVttBEsradSXbFiY9RgqPkTQAf3P2eFqRYSXiiFzdhSjGPZ6G1DWLRsec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589460236; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=taG7JaaZxlvXOxREvm0CKb5I6IOknbYNB4Twud4qGuw=; b=W/83583w9DjGzrzNPn1aWd2ymKXXsfV2xOSVIiP5tPpnHw12sqD5Rv6mDYpOeYObMWF/QPVm02lYK5Wggrp1qulwlbnPkGfoNhVsCOJHbUTJ95eRhefZViwaFjIgWhr3UgxqtyDzKP1MndONbxwIAAeEi8Bl9M/LedK8uMxlqAE= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=fail 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 1589460236357259.9145526132512; Thu, 14 May 2020 05:43:56 -0700 (PDT) Received: from localhost ([::1]:52758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDDP-0003Tw-1w for importer@patchew.org; Thu, 14 May 2020 08:43:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7T-0003HB-K6; Thu, 14 May 2020 08:37:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:3940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7S-0006Vv-Nh; Thu, 14 May 2020 08:37:47 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECWMMj038728; Thu, 14 May 2020 08:37:45 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3111w8gjpr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:45 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECWPhe040317; Thu, 14 May 2020 08:37:44 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 3111w8gjnu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:44 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZL7W008048; Thu, 14 May 2020 12:37:42 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma02fra.de.ibm.com with ESMTP id 3100ub9ghy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:42 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECbe4j53739960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:37:40 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B5D4A4054; Thu, 14 May 2020 12:37:40 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7408DA4066; Thu, 14 May 2020 12:37:39 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:39 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 9/9] pc-bios: s390x: Make u32 ptr check explicit Date: Thu, 14 May 2020 08:37:29 -0400 Message-Id: <20200514123729.156283-10-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 impostorscore=0 cotscore=-2147483648 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=594 phishscore=0 adultscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140109 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=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's make it a bit more clear that we check the full 64 bits to fit into the 32 we return. Signed-off-by: Janosch Frank Suggested-by: David Hildenbrand Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/helper.h b/pc-bios/s390-ccw/helper.h index 78d5bc7442..8a50ec91bb 100644 --- a/pc-bios/s390-ccw/helper.h +++ b/pc-bios/s390-ccw/helper.h @@ -18,7 +18,7 @@ /* Avoids compiler warnings when casting a pointer to a u32 */ static inline uint32_t ptr2u32(void *ptr) { - IPL_assert((uint64_t)ptr <=3D 0xffffffff, "ptr2u32: ptr too large"); + IPL_assert((uint64_t)ptr <=3D 0xffffffffull, "ptr2u32: ptr too large"); return (uint32_t)(uint64_t)ptr; } =20 --=20 2.25.1