From patchwork Thu Jul 5 17:25:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason J. Herne" X-Patchwork-Id: 940112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41M5Ms0BkRz9s1b for ; Fri, 6 Jul 2018 04:04:07 +1000 (AEST) Received: from localhost ([::1]:54152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb8bq-0008As-Vq for incoming@patchwork.ozlabs.org; Thu, 05 Jul 2018 14:04:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb80u-000062-HO for qemu-devel@nongnu.org; Thu, 05 Jul 2018 13:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fb80r-00013u-CI for qemu-devel@nongnu.org; Thu, 05 Jul 2018 13:25:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52716 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 1fb80r-00010y-6n for qemu-devel@nongnu.org; Thu, 05 Jul 2018 13:25:49 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w65HNgsd034222 for ; Thu, 5 Jul 2018 13:25:47 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k1npswhaa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 05 Jul 2018 13:25:47 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Jul 2018 13:25:47 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 5 Jul 2018 13:25:45 -0400 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w65HPh2213238558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 5 Jul 2018 17:25:43 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C5CFDAE062; Thu, 5 Jul 2018 13:25:23 -0400 (EDT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 997CFAE060; Thu, 5 Jul 2018 13:25:23 -0400 (EDT) Received: from jason-laptop.endicott.ibm.com (unknown [9.60.75.201]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 5 Jul 2018 13:25:23 -0400 (EDT) From: "Jason J. Herne" To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, cohuck@redhat.com, pasic@linux.ibm.com, bjsdjshi@linux.ibm.com, borntraeger@de.ibm.com Date: Thu, 5 Jul 2018 13:25:28 -0400 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18070517-0072-0000-0000-0000037A8A86 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009314; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01056994; UDB=6.00542264; IPR=6.00834914; MB=3.00022012; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-05 17:25:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070517-0073-0000-0000-0000489A78A0 Message-Id: <1530811543-6881-1-git-send-email-jjherne@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-05_06:, , 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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=920 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807050196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 X-Mailman-Approved-At: Thu, 05 Jul 2018 14:03:14 -0400 Subject: [Qemu-devel] [RFC 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. 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: 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 s390-bios: Use sense ccw to ensure consistent device state at boot time docs/devel/s390-dasd-ipl.txt | 132 +++++++++++++++++++++ hw/s390x/ipl.c | 15 +++ hw/s390x/s390-ccw.c | 9 ++ hw/vfio/ccw.c | 13 +- hw/vfio/ccw.h | 38 ++++++ include/hw/s390x/s390-ccw.h | 1 + pc-bios/s390-ccw/Makefile | 2 +- pc-bios/s390-ccw/cio.c | 181 ++++++++++++++++++++++++++++ pc-bios/s390-ccw/cio.h | 150 ++++++++++++++++------- pc-bios/s390-ccw/dasd-ipl.c | 249 +++++++++++++++++++++++++++++++++++++++ pc-bios/s390-ccw/dasd-ipl.h | 16 +++ pc-bios/s390-ccw/libc.h | 12 ++ pc-bios/s390-ccw/main.c | 162 ++++++++++++++++--------- pc-bios/s390-ccw/netmain.c | 1 + pc-bios/s390-ccw/s390-arch.h | 113 ++++++++++++++++++ pc-bios/s390-ccw/s390-ccw.h | 9 -- pc-bios/s390-ccw/virtio-blkdev.c | 1 + pc-bios/s390-ccw/virtio.c | 46 +------- 18 files changed, 986 insertions(+), 164 deletions(-) create mode 100644 docs/devel/s390-dasd-ipl.txt create mode 100644 hw/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/s390-arch.h