From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CA96C5519F for ; Fri, 20 Nov 2020 14:42:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66E0D2224C for ; Fri, 20 Nov 2020 14:42:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="dI6r5VQU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66E0D2224C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg7cK-00025K-5m for qemu-devel@archiver.kernel.org; Fri, 20 Nov 2020 09:42:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg7ae-00012P-K2; Fri, 20 Nov 2020 09:40:44 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:26240) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg7aT-0003gv-1N; Fri, 20 Nov 2020 09:40:43 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AKEW2fT187103; Fri, 20 Nov 2020 09:40:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=ynBAShRSwDfBrld04tuSkeXb3BkOTg/CDOMzEi1lQVg=; b=dI6r5VQUUsdGGuMY2hl9w4u7jspb2BpbXNIpx/GoenpfNS4Pd9nB76NLDzgOZ0aKa6jK fMW1dVx4PW6uV+rwt0p7S+/gqVK8C8FvV22l0FbQfKLDJQEubBLj4WdI2lu+YoWjIgpt s6S2D04H/g5SG6sL74JHZ5rrR/S2UXD7lRfyID8X3dt73bMXOSdvEUuc1Ys+D47L61ge /4zT3CWFTbCWUWeUJtmq8ERcAYnTPvU1zVekAVdjHWWYxco+cZ1DLaH18kLyYpHRb/Ix 4CBzv/x+DRlhARzKiJbJB7aDmqniQe3TDWy8TJ6Ujp8XPE9aZz0tV1Gj/dEt9C/UDLQY eA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34xd7mnawr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Nov 2020 09:40:03 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0AKEWCKJ188003; Fri, 20 Nov 2020 09:40:03 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 34xd7mnawe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Nov 2020 09:40:03 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AKEb5KL026293; Fri, 20 Nov 2020 14:40:02 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma02dal.us.ibm.com with ESMTP id 34vgjn5u89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Nov 2020 14:40:02 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AKEe0nJ3932792 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Nov 2020 14:40:00 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A30CB205F; Fri, 20 Nov 2020 14:40:00 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7BA56B2064; Fri, 20 Nov 2020 14:39:58 +0000 (GMT) Received: from [9.163.28.108] (unknown [9.163.28.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 20 Nov 2020 14:39:58 +0000 (GMT) Subject: Re: [PATCH 1/2] pc-bios: s390x: Ensure Read IPL memory is clean To: Janosch Frank , Thomas Huth , Cornelia Huck References: <20201119165729.63351-1-farman@linux.ibm.com> <20201119165729.63351-2-farman@linux.ibm.com> From: Eric Farman Message-ID: <70ad0d92-eca4-f5ca-65b1-d275cb8fa281@linux.ibm.com> Date: Fri, 20 Nov 2020 09:39:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-20_07:2020-11-20, 2020-11-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 spamscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011200096 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, NICE_REPLY_A=-0.001, 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 , Matthew Rosato , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Jared Rossi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 11/20/20 3:26 AM, Janosch Frank wrote: > On 11/19/20 5:57 PM, Eric Farman wrote: >> 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 > > Seems like I should have been more specific with my LGTM: > Reviewed-by: Janosch Frank Thanks, Janosch. I didn't want to put words in your acronym. :) > >> --- >> 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 = (Ccw0 *)0x00; >> >> + /* Clear out any existing data */ >> + memset(ccwIplRead, 0, sizeof(Ccw0)); >> + >> /* Create Read IPL ccw at address 0 */ >> ccwIplRead->cmd_code = CCW_CMD_READ_IPL; >> ccwIplRead->cda = 0x00; /* Read into address 0x00 in main memory */ >> >