From nobody Fri Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062647; cv=none; d=zohomail.com; s=zohoarc; b=Tzy7wfG4Vkykh+Pi0rj9b8z4nQvgA0tL8wPM3cz/BSipuBmZaFoO+F79x8RNzZFHzLfTGZ8njZVECiefj5Cqp5puxvZpbJQ62sXRG5ub3o7CC8uqm0kdjzeiF90L4nH3s94KDR3N6wl/XRoxKLA8HOw7c8pr524UdoUq5RQz8+M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062647; 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=zjmdWXp4ux/lZeG+gssvos0DK2IhyLWQfxf0fv7ra+8=; b=RGCOExxqzPtXi5lSSr4T/GS1NNK9FayxZjQ0Y46CYSRxlrGF5kJboeS0uyGq/pSLCxe94iIzLeoOOrm79+zQMdUZPta3p9P5lBLfvc/z+jtaIH2ua5EV7M6Bdv9k9fRBWteZPCldzPIrFX7Me6sVPi2w/gD9byK5wWnZ0/svwGw= 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 158506264728774.2615568565268; Tue, 24 Mar 2020 08:10:47 -0700 (PDT) Received: from localhost ([::1]:50422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlCY-0008L6-Ea for importer@patchew.org; Tue, 24 Mar 2020 11:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35693) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBT-0006sZ-6a for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBR-0003A5-QS for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:17310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGlBR-00039J-Ho for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:37 -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 02OF4KRV122569 for ; Tue, 24 Mar 2020 11:09:36 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywe7ted3s-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:36 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:32 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:29 -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 02OF9U4C51314844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:30 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96FEAA4060; Tue, 24 Mar 2020 15:09:30 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26560A405B; Tue, 24 Mar 2020 15:09:29 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:28 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 1/8] pc-bios: s390x: Consolidate timing functions into time.h Date: Tue, 24 Mar 2020 11:08:40 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-4275-0000-0000-000003B22CD4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-4276-0000-0000-000038C766F9 Message-Id: <20200324150847.10476-2-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=939 impostorscore=0 bulkscore=0 phishscore=0 spamscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=1 malwarescore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 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 ce3815b2010d20cb..7925c33248836913 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 309ffa30d9922077..a8e2b1b6233735d8 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_milli() + val; } =20 int get_timer(void) { - return dest_timer - get_timer_ms(); + return dest_timer - get_time_milli(); } =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 21f27e79906ea297..c5820e43aed143d0 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 0000000000000000..98f5acaa33b500bd --- /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_milli(void) +{ + /* Bit 51 is incremented each microsecond */ + return (get_clock() >> 12) / 1000; +} + +static inline u64 get_time_seconds(void) +{ + return (get_time_milli()) / 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 ff7f4dad2597eeae..4de03728bb648be1 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 4fe4b9d261a6c88d..0620651da82d569d 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 fb40ca982853a8d7..43717b83d7b2a9b9 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062786; cv=none; d=zohomail.com; s=zohoarc; b=JBu3tvGolA7mYwxJYSJvEd39IBpfQvPZQutdtdJcgWbuAMXrY2T9jd6jPTzOW7BVp3AX7Qy2F52nEirpKq6agVyaSUnK2EF+aZGOeTzknz90eXNV4PE74SJADcSSZcSPSeQ5blV93tJKeWyIzpZKTQjkgaY5ofQyvlQ/K2tYgDU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062786; 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=onY8loy1dXE5pOtFmYsi91qNBuVBPUGlcBuyrP/3JkU=; b=b+vfKJyorwmEDQ8Rjuunar1gkzubTi+x9TdYEPFVWgujdOTTMoqStr+YkJWbHC7HXoV22+DP6bSYLmAJTHOfoPqywoGrCQnfKPHPz4jbp0EqQ7vGtE3uW21EU/GrYLazRo1kO9VwmzbizP/3AYTzvNpI3uaHPcb9EJwXay3SyFY= 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 158506278637489.14836700335229; Tue, 24 Mar 2020 08:13:06 -0700 (PDT) Received: from localhost ([::1]:50484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlEn-00048j-ES for importer@patchew.org; Tue, 24 Mar 2020 11:13:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35748) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBW-0006x6-JO for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBV-0003Dz-DV for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:4820) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGlBV-0003D3-4h for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:41 -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 02OF5qHr059810 for ; Tue, 24 Mar 2020 11:09:40 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yxw7dfbc3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:37 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:33 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:31 -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 02OF9W5Y47317216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63C8AA4054; Tue, 24 Mar 2020 15:09:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 00660A405B; Tue, 24 Mar 2020 15:09:31 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:30 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 2/8] pc-bios: s390x: Get rid of magic offsets into the lowcore Date: Tue, 24 Mar 2020 11:08:41 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0016-0000-0000-000002F6ED17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0017-0000-0000-0000335A8B78 Message-Id: <20200324150847.10476-3-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=581 mlxscore=0 suspectscore=1 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 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 --- 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 aaa432deddb9242e..9ad794a789c47df2 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: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 4e65b411e1d890ba..8b912454c940a390 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062685; cv=none; d=zohomail.com; s=zohoarc; b=nWTLz22zaQRmR9xVljvLQnvwn8mAguLZiCKX8o1HOLJsivwCLUwYW7nME9KoPGqsZjvV+wTYeyoAgyv20SpK0wZKRz0WiFy89S+FA1+wwVSr2a0qdyP9ZeFZqe1ASWV40J4rw+DlEOlpTXS8jzyBD9d0pRFbNDL/6VbGbrmqA8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062685; 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=/GZUXZHzIp2wZ14HyL5ssHOu+q0mnW9QEGpHLDuXAIE=; b=gQRSmBGbBGIKU2L/RVMeUecFl2aXKvd2vCVB/O1KGDhXgxrzpgtUW5koUfzdtUAz5rw9nIeEbm7vVOfkKc5lbv/WOlt8hpwuIo2vVzRL2M5JU8SrkSwLAzBL+XohekxS/R5M9ltBdWyK//hTd/MHgkw7h0zUWhDJJU6GuzbJHPA= 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 1585062685726839.0829645654652; Tue, 24 Mar 2020 08:11:25 -0700 (PDT) Received: from localhost ([::1]:50434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlDA-0000xz-QG for importer@patchew.org; Tue, 24 Mar 2020 11:11:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35719) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBU-0006tL-Bn for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBT-0003Bb-C0 for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:40 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:8722 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 1jGlBT-0003B6-7B for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:39 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02OF5SGL103942 for ; Tue, 24 Mar 2020 11:09:38 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yyj4053qg-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:38 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:34 -0000 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:33 -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 02OF8WST42402198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:08:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 12CDCA4062; Tue, 24 Mar 2020 15:09:34 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C33F4A405B; Tue, 24 Mar 2020 15:09:32 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:32 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 3/8] pc-bios: s390x: Rename and use PSW_MASK_ZMODE constant Date: Tue, 24 Mar 2020 11:08:42 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-4275-0000-0000-000003B22CD6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-4276-0000-0000-000038C766FC Message-Id: <20200324150847.10476-4-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 suspectscore=1 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=990 bulkscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 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 0fc879bb8e8faac7..b932531e6f838405 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 5f36361c0223d434..73852029d4e92cd9 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062757; cv=none; d=zohomail.com; s=zohoarc; b=mrHLOm3qBQjrVFb+/MHT8J9l+5zoDqGeNWfbckKkfkmWdS3pYCucUgzDQu3JB8IoLC3WrZR3Z6yk1R8Wa+B2jdMyOsXilppXgMht+uoOgBzZeGLY0BBlHANaWQQnp86EtlJaEnAe5IgUrJQp2GQGUMTRJlV3qvo8OtpWN3ZXvsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062757; 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=fZ4SGbd/qtr9ysw5i8LMu5f0zkkB5DQdvN2WUQ73ruQ=; b=BzCGdu0qNeddZgY1x44ZLPSwxWEkaj/0vCPeGnqgOx74CQnc6O0fhs5E33+13Kmmp8SVJJdYR4lk5ycInlN/48LdNrKDYboXa8odlutmfhwzVse+DbT7gMkyo0H0i+h+a7z/byvu2rcQufp20tcjZqolqr3KIQrQdkCuDSeN4O8= 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 1585062757558339.66690540687284; Tue, 24 Mar 2020 08:12:37 -0700 (PDT) Received: from localhost ([::1]:50472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlEK-0003E7-NE for importer@patchew.org; Tue, 24 Mar 2020 11:12:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35766) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBX-000700-Ni for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBW-0003F9-CU for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32382 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 1jGlBW-0003EY-6T for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:42 -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 02OF3vWf062756 for ; Tue, 24 Mar 2020 11:09:41 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ywbuvhm3w-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:41 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:38 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:35 -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 02OF9ZuN23068816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:35 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B1FC9A405C; Tue, 24 Mar 2020 15:09:35 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7626AA405F; Tue, 24 Mar 2020 15:09:34 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:34 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 4/8] pc-bios: s390x: Use PSW masks where possible Date: Tue, 24 Mar 2020 11:08:43 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0008-0000-0000-000003631204 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0009-0000-0000-00004A847E90 Message-Id: <20200324150847.10476-5-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 impostorscore=0 mlxlogscore=913 suspectscore=1 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 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 4eba2510b045ff06..767012bf0c9f587e 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 73852029d4e92cd9..6da44d4436c75b55 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062856; cv=none; d=zohomail.com; s=zohoarc; b=dX4MuowsQCy6azJVoU2bpY3O2ZrfSE9KWA7uIsJknugjHll7RHGsK3/iGCFr/9uz+4JoXvZIMP2JVbg7Q8I1tNcwLt92jznm3C3chwhjPKKMaLFURZuUe2q4mHOGuDCsGzz7MbwoNKyupycUWGVwOLMlPHAYw3D9+hO+HzlVgLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062856; 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=etJinZEupnFMF3/jKY9fY1Z0XaU+rQlyc2iNt+a/rCo=; b=EQQ8Yi6eEsAKe+CeF63iSCuwezq6JTke9pjvb0pBUPyXLdzEBL1Qrhjx/u7Pi64zZ+UL8DWdL+wTegGwthK37azqmrRtgXLv9f6QZis8+nyLzrwEhORqxx3QsGJldityxpGW69IBpqoeNPBm7Z2Ro3q9z0AUI9jvGRl6r+N1+v4= 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 1585062856630176.70271899031752; Tue, 24 Mar 2020 08:14:16 -0700 (PDT) Received: from localhost ([::1]:50514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlFv-000637-Ph for importer@patchew.org; Tue, 24 Mar 2020 11:14:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35801) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBZ-00075b-Th for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBY-0003HY-Oq for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:23936 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 1jGlBY-0003H7-Jy for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:44 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02OF5JN6103394 for ; Tue, 24 Mar 2020 11:09:44 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yyj4053t3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:43 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:39 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:35 -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 02OF9btf28966934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:37 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 691C2A4062; Tue, 24 Mar 2020 15:09:37 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 123C5A405F; Tue, 24 Mar 2020 15:09:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:35 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 5/8] pc-bios: s390x: Move panic() into header and add infinite loop Date: Tue, 24 Mar 2020 11:08:44 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0020-0000-0000-000003BA359D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0021-0000-0000-00002212B6C4 Message-Id: <20200324150847.10476-6-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 suspectscore=1 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=961 bulkscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 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 --- pc-bios/s390-ccw/main.c | 7 ------- pc-bios/s390-ccw/netmain.c | 8 -------- pc-bios/s390-ccw/s390-ccw.h | 7 ++++++- pc-bios/s390-ccw/start.S | 5 +++-- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index 8b912454c940a390..146a50760bc70af7 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 a8e2b1b6233735d8..ca23f9bb19a3e04c 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 c5820e43aed143d0..b3dcfbc3c9b3814c 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -55,7 +55,6 @@ 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 aa8fceb19da2164a..35be141d8da38d07 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062754; cv=none; d=zohomail.com; s=zohoarc; b=Od/cd+LXgg8JpwRLE/f1RxGGPlQbeKywzwQNCGwRaGVYtDq1BJcoEaTNxqAJ9afBLfWYWVw8bq74wsI4JpT8uxpijZxCvxNOFXg9gxAoLHR7T0MsVSWEn1MZv2htOQbhxmQJJkmL6NVsxXOO/wjyv++0OsUdu88tvMvQPL3WvEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062754; 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=wdLeObKoVNbB36QT1ul9np7e0IUqM9a3d7QuTXRoSlA=; b=aHm+P4PebR4lGWgRR4nQFHu9ZHq2bTtlUrOsxXL4l7yoxLUKk3CTIZx1fTf8wMNRjnVDwHXQHlfoWi0a83R1aOVycyYekkk9R9Fi7O6bKoEtl/zNCzVunfWKik2sSZwsd5wAMfQZMugabe78b3AYMdGRIWyxS/foweeJS8Sv6gc= 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 1585062754674693.8285918005996; Tue, 24 Mar 2020 08:12:34 -0700 (PDT) Received: from localhost ([::1]:50470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlEH-00037A-Pv for importer@patchew.org; Tue, 24 Mar 2020 11:12:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35820) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBa-00077f-Lj for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBZ-0003Ix-LG for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGlBZ-0003Hp-ED for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:45 -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 02OF4NGi053330 for ; Tue, 24 Mar 2020 11:09:44 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywf3f5kg2-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:44 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:41 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:39 -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 02OF9dq435258556 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:39 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 30063A4054; Tue, 24 Mar 2020 15:09:39 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2010A4062; Tue, 24 Mar 2020 15:09:37 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:37 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 6/8] pc-bios: s390x: Use ebcdic2ascii table Date: Tue, 24 Mar 2020 11:08:45 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0028-0000-0000-000003EAA1D8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0029-0000-0000-000024B00BF3 Message-Id: <20200324150847.10476-7-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=971 impostorscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 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 --- 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 d13b7cbd1597bf2e..97205674e59aebb2 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062899; cv=none; d=zohomail.com; s=zohoarc; b=m+cBIE65xWS8bNjfrwoVDGojZIzC7cHFUL9pLBqOnjeISlMigQ1anlFxKb0F/y9AaXnLDV/1bKFZgRDppyPKeNFnaxpYCqAlatF2/LHl4LXRNeqMH0dVW/z60EtfixlKgu+Wsf4j7rdONjjPrLBGjL8xt9McPVuFmfSBSDOnnDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062899; 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=6t6bT9bU+wrSbHajS1urF28JuIk0oJGyXbI8ayhZc0Y=; b=IhO4SQ+lur00sM21nwlG5bTAAEHBKI3v4HHKVe0A8z0ZoNU2tDBv4W28GQ5IXco/u9HLAK6S3B4khH2CD8koohxGpngZPOCds2vsg9Vc0wH2Y8RSbe0Tnbf8Rk7OU7JDaTmVvVPFVbtE59+Wfm0sRedakJDvXgIYqKAtAuAZ7lI= 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 1585062899340793.5159523261539; Tue, 24 Mar 2020 08:14:59 -0700 (PDT) Received: from localhost ([::1]:50524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlGc-00074f-DP for importer@patchew.org; Tue, 24 Mar 2020 11:14:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35864) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBd-0007DQ-BY for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBc-0003Lq-7O for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGlBb-0003Ky-VJ for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:48 -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 02OF5mFl059476 for ; Tue, 24 Mar 2020 11:09:47 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yxw7dfbhm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:46 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:43 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:40 -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 02OF9ema44957982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:41 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E51ACA4060; Tue, 24 Mar 2020 15:09:40 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92C34A405B; Tue, 24 Mar 2020 15:09:39 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:39 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 7/8] pc-bios: s390x: Replace 0x00 with 0x0 or 0 Date: Tue, 24 Mar 2020 11:08:46 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0012-0000-0000-00000396E73F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0013-0000-0000-000021D3DBAE Message-Id: <20200324150847.10476-8-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=456 mlxscore=0 suspectscore=1 bulkscore=0 priorityscore=1501 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240079 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 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 --- 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 b932531e6f838405..764ee89e92e3ae8d 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 Apr 26 10:45:59 2024 Delivered-To: importer@patchew.org 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; 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=1585062831; cv=none; d=zohomail.com; s=zohoarc; b=g23bm9IQig/NUCWYG/gkcFRRz/QjikjAOEejElhQVluGZhWSaiRck/RCdLTVjIL/tGTMAU8XBAFSWTPXBa9o17R9h4vYj4y09Eb547ZBHDzhWIkZ3LLgH4GRFVy5DFMm5LQsMT3a+yepPFqIHjbKvpQhPm09BqWVwZGSBh5oDZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585062831; 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=JkgdTzA2Fe5bl/01ILy1Bi3V/Eeq6UkcF6Lga+xSedA=; b=Jxs63KhO9WxGYzYGNutl4iTfBuyNbvbdG1F0yqZk+jT/wMiiebBUEc+/3Tbl15akcRpSrRsmqYQj7MMM9+lBooWWFKysxDoqz0BCeyht5nLMSGx0GkabSrVuyfgBF7MjZuLgM+Oti58+5E1ErZ22Stu9HnrVTLYfq7oZmHGsLX4= 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 1585062831412278.3926382012013; Tue, 24 Mar 2020 08:13:51 -0700 (PDT) Received: from localhost ([::1]:50508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlFW-0005MI-GM for importer@patchew.org; Tue, 24 Mar 2020 11:13:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35867) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGlBd-0007Dp-Hi for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGlBc-0003MD-El for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:49 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:27782 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 1jGlBc-0003LZ-AG for qemu-devel@nongnu.org; Tue, 24 Mar 2020 11:09:48 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02OF3W6H106676 for ; Tue, 24 Mar 2020 11:09:47 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywet3qa05-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 24 Mar 2020 11:09:47 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Mar 2020 15:09:43 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 24 Mar 2020 15:09:41 -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 02OF9gCh30015534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Mar 2020 15:09:42 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C62DA4060; Tue, 24 Mar 2020 15:09:42 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 539F9A4054; Tue, 24 Mar 2020 15:09:41 +0000 (GMT) Received: from localhost.localdomain (unknown [9.145.9.40]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 24 Mar 2020 15:09:41 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH 8/8] pc-bios: s390x: Make u32 ptr check explicit Date: Tue, 24 Mar 2020 11:08:47 -0400 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200324150847.10476-1-frankja@linux.ibm.com> References: <20200324150847.10476-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032415-0016-0000-0000-000002F6ED18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032415-0017-0000-0000-0000335A8B79 Message-Id: <20200324150847.10476-9-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-24_05:2020-03-23, 2020-03-24 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=511 adultscore=0 spamscore=0 clxscore=1015 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=1 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003240083 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 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 --- 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 78d5bc74421b4173..b4e83a7e5deaa9dc 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 0xfffffffful, "ptr2u32: ptr too large"); return (uint32_t)(uint64_t)ptr; } =20 --=20 2.25.1