From patchwork Mon Mar 11 15:21:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 10847775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2223C1515 for ; Mon, 11 Mar 2019 16:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B3222929E for ; Mon, 11 Mar 2019 16:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0997B292A1; Mon, 11 Mar 2019 16:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 767BA292AC for ; Mon, 11 Mar 2019 16:02:47 +0000 (UTC) Received: from localhost ([127.0.0.1]:35566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3NA2-0002YX-Q1 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 Mar 2019 11:48:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Mwb-0005vi-Cp for qemu-devel@nongnu.org; Mon, 11 Mar 2019 11:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3MkI-0006me-O8 for qemu-devel@nongnu.org; Mon, 11 Mar 2019 11:21:43 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3MkI-0006iB-Bw for qemu-devel@nongnu.org; Mon, 11 Mar 2019 11:21:42 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2BFGbkx073441 for ; Mon, 11 Mar 2019 11:21:40 -0400 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0a-001b2d01.pphosted.com with ESMTP id 2r5rh6p5c6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Mar 2019 11:21:40 -0400 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Mar 2019 15:21:38 -0000 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 11 Mar 2019 15:21:36 -0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x2BFLYkS12124198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2019 15:21:34 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01142112063; Mon, 11 Mar 2019 15:21:34 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3ECC11206D; Mon, 11 Mar 2019 15:21:33 +0000 (GMT) Received: from jason-laptop.endicott.ibm.com (unknown [9.60.75.251]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 11 Mar 2019 15:21:33 +0000 (GMT) From: "Jason J. Herne" To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, thuth@redhat.com, pasic@linux.ibm.com, alifm@linux.ibm.com, borntraeger@de.ibm.com Date: Mon, 11 Mar 2019 11:21:18 -0400 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 19031115-2213-0000-0000-00000361B050 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010739; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000281; SDB=6.01172861; UDB=6.00613172; IPR=6.00953516; MB=3.00025928; MTD=3.00000008; XFM=3.00000015; UTC=2019-03-11 15:21:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031115-2214-0000-0000-00005DA27972 Message-Id: <1552317693-21979-1-git-send-email-jjherne@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-03-11_12:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903110109 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v4 00/15] s390: vfio-ccw dasd ipl support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is to support booting from vfio-ccw dasd devices. We basically implement the real hardware ipl procedure. This allows for booting Linux guests on vfio-ccw devices. vfio-ccw's channel program prefetch algorithm complicates ipl because most ipl channel programs dynamically modify themselves. Details on the ipl process and how we worked around this issue can be found in docs/devel/s390-dasd-ipl.txt. ********************* NOTE: Newer DASD units which initially present as control unit type 3990 may in fact really be 2107. Some operating systems may enable 2107 features for these devices thereby making sense id return a control unit type of 2107. I've added support for control unit type 2107 so we can ipl from these devices. ********************* Changelog ========== v4 01/16: s390 vfio-ccw: Add bootindex property and IPLB data - Adding CCW_DEVTYPE_VIRTIO_NET type. - s390_get_ccw_device can now accept a NULL devtype argument - Other minor refactors 06/16: s390-bios: Clean up cio.h - Remove whitespace changes to cmd_orb struct 07/16: s390-bios: Decouple channel i/o logic from virtio - Fix copyright line 08/16: s390-bios: Map low core memory - Remove Lowcore entries >= 0x200 - Repositioned const keywords 09/16: s390-bios: ptr2u32 and u32toptr - Add assert to ensure pointer being converted to u32 is below 32 bits in length - Add missing copyright comment 10/16: s390-bios: Support for running format-0/1 channel programs - basic_sense now calls __do_cio instead of do_cio. Further protection from infinite recursion. - __do_cio now asks for retry for subchannel busy case. - Minor fixups to comments and message wording - start.S: Formating and register naming cleanups - Added CU_TYPE_DASD_2107 11/16: s390-bios: cio error handling - Only print sense data when it is provided 15/16: - Added support for CU_TYPE_DASD_2107 16/16: - Merged with various earlier patches Jason J. Herne (15): s390 vfio-ccw: Add bootindex property and IPLB data s390-bios: decouple cio setup from virtio s390-bios: decouple common boot logic from virtio s390-bios: Extend find_dev() for non-virtio devices s390-bios: Factor finding boot device out of virtio code path s390-bios: Clean up cio.h s390-bios: Decouple channel i/o logic from virtio s390-bios: Map low core memory s390-bios: ptr2u32 and u32toptr s390-bios: Support for running format-0/1 channel programs s390-bios: cio error handling s390-bios: Refactor virtio to run channel programs via cio s390-bios: Use control unit type to determine boot method s390-bios: Add channel command codes/structs needed for dasd-ipl s390-bios: Support booting from real dasd device MAINTAINERS | 2 + docs/devel/s390-dasd-ipl.txt | 133 ++++++++++++++ hw/s390x/ipl.c | 61 +++++-- hw/s390x/s390-ccw.c | 9 + hw/vfio/ccw.c | 2 +- include/hw/s390x/s390-ccw.h | 1 + include/hw/s390x/vfio-ccw.h | 28 +++ pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/cio.c | 423 +++++++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 270 +++++++++++++++++++++------ pc-bios/s390-ccw/dasd-ipl.c | 250 +++++++++++++++++++++++++ pc-bios/s390-ccw/dasd-ipl.h | 16 ++ pc-bios/s390-ccw/helper.h | 31 ++++ pc-bios/s390-ccw/libc.h | 11 ++ pc-bios/s390-ccw/main.c | 161 ++++++++++------ pc-bios/s390-ccw/netboot.mak | 2 +- pc-bios/s390-ccw/netmain.c | 2 + pc-bios/s390-ccw/s390-arch.h | 103 +++++++++++ pc-bios/s390-ccw/s390-ccw.h | 10 +- pc-bios/s390-ccw/start.S | 29 +++ pc-bios/s390-ccw/virtio.c | 73 ++------ tests/boot-serial-test.c | 2 +- 22 files changed, 1425 insertions(+), 196 deletions(-) create mode 100644 docs/devel/s390-dasd-ipl.txt create mode 100644 include/hw/s390x/vfio-ccw.h create mode 100644 pc-bios/s390-ccw/cio.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.c create mode 100644 pc-bios/s390-ccw/dasd-ipl.h create mode 100644 pc-bios/s390-ccw/helper.h create mode 100644 pc-bios/s390-ccw/s390-arch.h --- 2.7.4