From nobody Thu Mar 28 14:57:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1605805202; cv=none; d=zohomail.com; s=zohoarc; b=eLFjlu5li7D5d4DqUIiNatGEfjMtQFsdBRuZ+rtGsO0divGf2sDs6YHPAZcH1coiTAdy7ZR5szXRvIrUXeUNrcvOVoioc67Xy2SwkRakVXjL5WW5WOHtwduO7nEhUvVahNDmNAroGUgMy5QQgTIRTGMjb1rskDCKOIW9iZoY8kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605805202; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=E0GTTVgyXhj12pa0mJauQFYiR/f4GUZbXKslJM7vJic=; b=Vp7YUG5peokwiv8nCZyXBF96xp+KH130IHqu24GjOkonXLtJOClQ8zBkJL/d58Oxq8W+CLnpkLIjJs7+hGVQ9/Rx0WTtg2w05L1F+UO7b0FpTQPJCOKrwouof2PDhmC9CBySwYY2tOjy6nDbUXwj5J2+luUDUiUYto0TUoKyXUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1605805202030800.8559098762316; Thu, 19 Nov 2020 09:00:02 -0800 (PST) Received: from localhost ([::1]:38830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfnHs-0001Jn-5g for importer@patchew.org; Thu, 19 Nov 2020 12:00:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfnFe-0008ID-PY; Thu, 19 Nov 2020 11:57:42 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40036 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 1kfnFc-0004eD-VF; Thu, 19 Nov 2020 11:57:42 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AJGXbTL181894; Thu, 19 Nov 2020 11:57:40 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 34wumaancs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 11:57:39 -0500 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AJGY8EP185672; Thu, 19 Nov 2020 11:57:39 -0500 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 34wumaanas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 11:57:39 -0500 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AJGr7EP027956; Thu, 19 Nov 2020 16:57:34 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04fra.de.ibm.com with ESMTP id 34t6v8atv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 16:57:34 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AJGvVPo59900314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Nov 2020 16:57:31 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5293B4C05C; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 496D94C058; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 05DF8E23AD; Thu, 19 Nov 2020 17:57:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pp1; bh=E0GTTVgyXhj12pa0mJauQFYiR/f4GUZbXKslJM7vJic=; b=ZhhafVprA33uF4R3oW5Ig+OOdBrRQXkK0aYHbMvuFRt835stlu50oWlNr/ToA7NP75u4 4c7lEcrYIJymn9m7L3s9mdKfFMc4P3g77VMJmPscXAyqe5YDLmG+/iVfHEjqh76Y+KSQ DgkDHN+9Qj5bg/kxMzwyhzVMoO5/BllwkYRLywQmloiR9TMMWwCKvtbYYzjkNJIa0OQL 7OIJmWroUb82yw6q/4lJCP2aSvuaqr8WghWD6g7mSSePa1FfpLS72/oFzD6xX8s9jcK9 A7M4m/WeTA3jNOEQv8KSNChtgGb3PZq7DlP0CaPHZJygySiT5BNJPPah/fn6/fNQHlBg VQ== From: Eric Farman To: Thomas Huth , Cornelia Huck Subject: [PATCH 1/2] pc-bios: s390x: Ensure Read IPL memory is clean Date: Thu, 19 Nov 2020 17:57:28 +0100 Message-Id: <20201119165729.63351-2-farman@linux.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201119165729.63351-1-farman@linux.ibm.com> References: <20201119165729.63351-1-farman@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-19_09:2020-11-19, 2020-11-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 priorityscore=1501 adultscore=0 mlxlogscore=845 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011190118 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=farman@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: Jason Herne , Eric Farman , Janosch Frank , Matthew Rosato , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Jared Rossi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If, for example, we boot off a virtio device and chreipl to a vfio-ccw device, the space at lowcore will be non-zero. We build a Read IPL CCW at address zero, but it will have leftover PSW data that will conflict with the Format-0 CCW being generated: 0x0: 00080000 80010000 ------ Ccw0.cda -- Ccw0.chainData -- Reserved bits The data address will be overwritten with the correct value (0x0), but the apparent data chain bit will cause subsequent memory to be used as the target of the data store, which may not be where we expect (0x0). Clear out this space when we boot from DASD, so that we know it exists exactly as we expect. Signed-off-by: Eric Farman Reviewed-by: Jason J. Herne Acked-by: Christian Borntraeger Acked-by: Cornelia Huck Reviewed-by: Janosch Frank Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/dasd-ipl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c index 0fc879bb8e..71cbae2f16 100644 --- a/pc-bios/s390-ccw/dasd-ipl.c +++ b/pc-bios/s390-ccw/dasd-ipl.c @@ -100,6 +100,9 @@ static void make_readipl(void) { Ccw0 *ccwIplRead =3D (Ccw0 *)0x00; =20 + /* Clear out any existing data */ + memset(ccwIplRead, 0, sizeof(Ccw0)); + /* 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 */ --=20 2.17.1 From nobody Thu Mar 28 14:57:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1605805211; cv=none; d=zohomail.com; s=zohoarc; b=JF+1kefrreEFOP4kHGmvSpNvQ+uGYxXZ1dwfvOx6FTPPu6BBH7q+Jf1PuWOPFa+xSTyYROK8PzJevaDPFQvMofJZKbUl0zrQLp0qsgbwmjkwQeVYSJPDd2vVcdrLokDWUeusHrKQC5dnymUs2UY/60OBv4pQ9wu65buamOMr7/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605805211; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ya3pQN6oYVrioC/aUTTNBDEvS/PtAxIKdhXex56o5Uk=; b=MrUSasEGqK0Dy9VEsLP6cj+SdkX64l4j2SOhOurlN6aMfLKBGDradhFGa5aHQT56cdVR3pBHuHeGXjUktN1X617KzH/SFiqimRNFVLP+oB8PVsr259Flw4MvUvckXM+vpYPR7gxLE6ewuarJORvMeo1EFAsClFdjIgeiVJVj+0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1605805211307392.2682205290265; Thu, 19 Nov 2020 09:00:11 -0800 (PST) Received: from localhost ([::1]:39110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfnI0-0001Qr-E8 for importer@patchew.org; Thu, 19 Nov 2020 12:00:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfnFl-0008Pq-Hz; Thu, 19 Nov 2020 11:57:49 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:22398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfnFj-0004gD-7E; Thu, 19 Nov 2020 11:57:49 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AJGXWf0039575; Thu, 19 Nov 2020 11:57:46 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34wu6mja0e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 11:57:45 -0500 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AJGY1wr042907; Thu, 19 Nov 2020 11:57:40 -0500 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 34wu6mj9xa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 11:57:40 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AJGrNLI030562; Thu, 19 Nov 2020 16:57:34 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03ams.nl.ibm.com with ESMTP id 34weby0umx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Nov 2020 16:57:34 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AJGvVPs5571242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Nov 2020 16:57:31 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5145BA4059; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48374A4057; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 19 Nov 2020 16:57:31 +0000 (GMT) Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 4958) id 08C6FE23B1; Thu, 19 Nov 2020 17:57:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=pp1; bh=ya3pQN6oYVrioC/aUTTNBDEvS/PtAxIKdhXex56o5Uk=; b=AYFT3j/Dd+Luw5d0ZrIDWnCY2wvFz3yrHZg2tu9MeZ6nxsuiPdxZkH2Z8W3zjgNGq5Jr BYN8sbF90nmhJ3ht16HzkEbjSMKHFHq9eWHl//y4ljVC5IY3on94Wl3rVbbILdosYvON NedAD2F3G78gDSSoxrd0C9iBApM8uqg8P3LV2pNllHjQc+tUlqlUAxt54O3Od5mO3tQ4 cQLCSS37/KTzbWH3Ay6XwoNdxSVjsqrDBY54INjMAdSzfol0RMt2sc2RWZf0+N7iz5dg 5y7dAeZb3R+yjKpVRqOcSxRJ2rNy7Be84kt55/0Ns7a1IJMvqCGBM+OtNAGV/lhOLIsx 7Q== From: Eric Farman To: Thomas Huth , Cornelia Huck Subject: [PATCH 2/2] pc-bios: s390x: Give precedence to reset PSW Date: Thu, 19 Nov 2020 17:57:29 +0100 Message-Id: <20201119165729.63351-3-farman@linux.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201119165729.63351-1-farman@linux.ibm.com> References: <20201119165729.63351-1-farman@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-19_09:2020-11-19, 2020-11-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 bulkscore=0 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011190119 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=farman@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: Jason Herne , Eric Farman , Janosch Frank , Matthew Rosato , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Jared Rossi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Let's look at the Reset PSW first instead of the contents of memory. It might be leftover from an earlier system boot when processing a chreipl. Signed-off-by: Eric Farman --- pc-bios/s390-ccw/jump2ipl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c index fbae45b03c..67b4afb6a0 100644 --- a/pc-bios/s390-ccw/jump2ipl.c +++ b/pc-bios/s390-ccw/jump2ipl.c @@ -72,16 +72,6 @@ void jump_to_IPL_code(uint64_t address) =20 void jump_to_low_kernel(void) { - /* - * If it looks like a Linux binary, i.e. there is the "S390EP" magic f= rom - * arch/s390/kernel/head.S here, then let's jump to the well-known Lin= ux - * kernel start address (when jumping to the PSW-at-zero address inste= ad, - * the kernel startup code fails when we booted from a network device). - */ - if (!memcmp((char *)0x10008, "S390EP", 6)) { - jump_to_IPL_code(KERN_IMAGE_START); - } - /* Trying to get PSW at zero address */ if (*((uint64_t *)0) & RESET_PSW_MASK) { /* @@ -92,6 +82,16 @@ void jump_to_low_kernel(void) jump_to_IPL_code(0); } =20 + /* + * If it looks like a Linux binary, i.e. there is the "S390EP" magic f= rom + * arch/s390/kernel/head.S here, then let's jump to the well-known Lin= ux + * kernel start address (when jumping to the PSW-at-zero address inste= ad, + * the kernel startup code fails when we booted from a network device). + */ + if (!memcmp((char *)0x10008, "S390EP", 6)) { + jump_to_IPL_code(KERN_IMAGE_START); + } + /* No other option left, so use the Linux kernel start address */ jump_to_IPL_code(KERN_IMAGE_START); } --=20 2.17.1