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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 E84D4C56201 for ; Thu, 19 Nov 2020 17:53:04 +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 DDEF52220B for ; Thu, 19 Nov 2020 17:53:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L5TEfKpc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDEF52220B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfo7C-0001mb-FG for qemu-devel@archiver.kernel.org; Thu, 19 Nov 2020 12:53:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfo6Z-0001LU-Uh for qemu-devel@nongnu.org; Thu, 19 Nov 2020 12:52:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kfo6U-0008MH-Uh for qemu-devel@nongnu.org; Thu, 19 Nov 2020 12:52:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605808338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E7ukrd+iIv0292eKfrvFoYJmrxqkOybo+4dDldg37Pw=; b=L5TEfKpcVCm+Wy5FN2B4n7OAmNT4X2r6sj4N3lesjXh68T8+n67d46aGvdzI6BDVWm83vn AvTrIzrpthKW7SUjGOteA5MkNq4Uh0hvHFa6xMZkpFDJGulfXKej2b0c3d0pQiiaw9OXNi pqsF4Xb/rqO3KlHrj3q2ExGCUQzFVwA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-135-OvzBbnzBNNWH1TcOwUhizg-1; Thu, 19 Nov 2020 12:52:14 -0500 X-MC-Unique: OvzBbnzBNNWH1TcOwUhizg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C32FD8144ED; Thu, 19 Nov 2020 17:52:12 +0000 (UTC) Received: from gondolin (ovpn-113-214.ams2.redhat.com [10.36.113.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id B23E05D6A8; Thu, 19 Nov 2020 17:52:10 +0000 (UTC) Date: Thu, 19 Nov 2020 18:52:08 +0100 From: Cornelia Huck To: Eric Farman Subject: Re: [PATCH 0/2] pc-bios/s390 fixes for reboot-to-vfio-ccw Message-ID: <20201119185208.562680ff.cohuck@redhat.com> In-Reply-To: <20201119165729.63351-1-farman@linux.ibm.com> References: <20201119165729.63351-1-farman@linux.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 , Thomas Huth , Janosch Frank , 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 Thu, 19 Nov 2020 17:57:27 +0100 Eric Farman wrote: > Hi Conny, Thomas, > > I've come across a couple problems when installing a guest onto a > vfio-ccw disk. They were noticed when booting off an ISO via virtio, > and writing the new guest OS to a vfio-ccw connected disk. The > installation works correctly, in that the disk can be booted and > used perfectly fine. But the end of the install process reboots to > the new disk, and we end up with an error that looks like this: > > Rebooting. > LOADPARM=[ ] > cio device error > ssid : 0x0000000000000000 > cssid : 0x0000000000000000 > sch_no: 0x0000000000000002 > ctrl-unit type: 0x0000000000003990 > > Interrupt Response Block Data: > : 0x0000000000003990 > Function Ctrl : [Start] > Activity Ctrl : [Start-Pending] > Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending] > Device Status : > Channel Status : [Program-Check] > cpa=: 0x0000000000000008 > prev_ccw=: 0x0008000080002018 > this_ccw=: 0x0600001860000080 > Eckd Dasd Sense Data (fmt 32-bytes): > Channel Status : [Program-Check] > Sense Condition Flags : > Residual Count =: 0x0000000000000000 > Phys Drive ID =: 0x0000000000000000 > low cyl address =: 0x0000000000000000 > head addr & hi cyl =: 0x0000000000000000 > format/message =: 0x0000000000000000 > fmt-dependent[0-7] =: 0x0000000000000000 > fmt-dependent[8-15]=: 0x000000004a200f00 > prog action code =: 0x0000000000000000 > Configuration info =: 0x00000000000040e0 > mcode / hi-cyl =: 0x0000000000000000 > cyl & head addr [0]=: 0x0000000000000000 > cyl & head addr [1]=: 0x0000000000000000 > cyl & head addr [2]=: 0x0000000000000000 > dasd-ipl: Failed to run Read IPL channel program > > The problem can be easily (and quickly) reproduced by defining > XML with two different guest disks, such as: > > > > > >
> > > >
> >
> > > Boot the guest off disk 1234, issue `chreipl 0.0.1235`, and reboot. > Interestingly, going the other direction (1235->1234) works fine. > > Two things occur here. First, the DASD IPL code builds a Read IPL > Format-0 CCW at address zero, but assumes that the memory is already > zero. If data is already present (which on reboot it does, and is > probably a PSW), it might be included in that CCW. Patch 1 is a > pretty straightforward fix for this. (Might this one be appropriate > for 5.2?) That one is straightforward enough for 5.2, I guess. > > Secondly, the jump code looks at a couple memory locations to determine > what jump to perform. But in this virtio-to-vfio jump, we should give > precedence to the data at address zero, rather than the not-yet-cleared > memory. Patch 2 swaps the order of these checks to enable this, and > doesn't appear to affect normal disk boots. But there are a hundred > other boot combinations that I haven't tried here, so could use some > feedback on this one. I do recognize that this leaves no difference > between the "if (!memcmp())" case and not, but left it this way to > help better visualize the change I'm making. This is in code that usually gives me a headache :( > > Coda: > I didn't include rebuilt bios patch(es) here, but certainly can. I think it should not be too hard to have the person picking the patches generate them :) Especially if we end up going with patch 1 only for now. > Also, I'm on holiday all next week; so apologies in advance for > sending a couple patches and then hiding shortly thereafter. :) That's a time-proven strategy :) > > Eric Farman (2): > pc-bios: s390x: Ensure Read IPL memory is clean > pc-bios: s390x: Give precedence to reset PSW > > pc-bios/s390-ccw/dasd-ipl.c | 3 +++ > pc-bios/s390-ccw/jump2ipl.c | 20 ++++++++++---------- > 2 files changed, 13 insertions(+), 10 deletions(-) >