From patchwork Fri Jun 29 22:47:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Krowiak X-Patchwork-Id: 937207 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.vnet.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 41HWzb5Yl7z9rvt for ; Sat, 30 Jun 2018 08:49:14 +1000 (AEST) Received: from localhost ([::1]:44764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ2CV-0001AC-0t for incoming@patchwork.ozlabs.org; Fri, 29 Jun 2018 18:49:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ2Bg-00019m-95 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 18:48:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ2Bd-00006L-61 for qemu-devel@nongnu.org; Fri, 29 Jun 2018 18:48:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fZ2Bc-00005a-Tl for qemu-devel@nongnu.org; Fri, 29 Jun 2018 18:48:17 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5TMiRX5139683 for ; Fri, 29 Jun 2018 18:48:15 -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 2jwujkc8va-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 29 Jun 2018 18:48:15 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Jun 2018 18:48:14 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) 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) Fri, 29 Jun 2018 18:48:10 -0400 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5TMm8ag10879280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 29 Jun 2018 22:48:08 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D57828058; Fri, 29 Jun 2018 18:47:45 -0400 (EDT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5C75328059; Fri, 29 Jun 2018 18:47:44 -0400 (EDT) Received: from localhost.localdomain (unknown [9.85.157.42]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS; Fri, 29 Jun 2018 18:47:44 -0400 (EDT) From: Tony Krowiak To: qemu-devel@nongnu.org Date: Fri, 29 Jun 2018 18:47:58 -0400 X-Mailer: git-send-email 1.7.1 X-TM-AS-GCONF: 00 x-cbid: 18062922-0072-0000-0000-000003776011 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009279; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01054221; UDB=6.00540601; IPR=6.00832144; MB=3.00021935; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-29 22:48:13 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062922-0073-0000-0000-00004889198A Message-Id: <1530312483-23864-1-git-send-email-akrowiak@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-29_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1806210000 definitions=main-1806290243 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v6 0/5] s390x: vfio-ap: guest dedicated crypto adapters 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: , Cc: peter.maydell@linaro.org, akrowiak@linux.vnet.ibm.com, cohuck@redhat.com, david@redhat.com, pmorel@linux.vnet.ibm.com, eskultet@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, jjherne@linux.vnet.ibm.com, Tony Krowiak , heiko.carstens@de.ibm.com, eric.auger@redhat.com, alex.williamson@redhat.com, bjsdjshi@linux.vnet.ibm.com, rth@twiddle.net, mjrosato@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com, qemu-s390x@nongnu.org, schwidefsky@de.ibm.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Tony Krowiak This patch series is the QEMU counterpart to the KVM/kernel support for guest dedicated crypto adapters. The KVM/kernel model is built on the VFIO mediated device framework and provides the infrastructure for granting exclusive guest access to crypto devices installed on the linux host. This patch series introduces a new QEMU command line option, QEMU object model and CPU model features to exploit the KVM/kernel model. See the detailed specifications for AP virtualization provided by this patch set in docs/vfio-ap.txt for a more complete discussion of the design introduced by this patch series. Note: This series implements the minimal viable product (MVP) and does not provide support for hot plug/unplug or migration. The goal of the MVP model is to solidify a base upon which these additional features will be built. --- v5 => v6 Change log: =================== * Added reset handling fo vfio-ap device * Added a bridge/bus to AP device object model - thanks to Halil Pasic v4 => v5 Change log: =================== * Added MAINTAINERS entries for VFIO AP * Added explanation for why we are only supporting zEC12 and newer CPU models. * Changed CPU model feature qci=on|off to apqci=on|off * Misc. minor changes v3 => v4 Change log: =================== * Made vfio-ap device unpluggable for now * Renamed command line CPU model feature for QCI: qci=on -> apqci=on * Removed call to KVM_S390_VM_CRYPTO_INTERPRET_AP ioctl - ioctl was removed from kernel and AP instruction interpretation is set from the VFIO device driver * Added check to ensure only one vfio-ap device can be configured per guest * Removed AP instruction interception handlers: AP instructions will be interpreted by default if AP facilities are installed to handle the case where feature ap=on and no vfio-ap device is configured for the guest. Tony Krowiak (5): linux-headers: linux header updates for AP support s390x/cpumodel: Set up CPU model for AP device support s390x/ap: base Adjunct Processor (AP) object model s390x/vfio: ap: Introduce VFIO AP device s390: doc: detailed specifications for AP virtualization MAINTAINERS | 14 + default-configs/s390x-softmmu.mak | 1 + docs/vfio-ap.txt | 649 +++++++++++++++++++++++++++++++++++++ hw/s390x/Makefile.objs | 2 + hw/s390x/ap-bridge.c | 76 +++++ hw/s390x/ap-device.c | 39 +++ hw/s390x/s390-virtio-ccw.c | 4 + hw/vfio/Makefile.objs | 1 + hw/vfio/ap.c | 183 +++++++++++ include/hw/s390x/ap-bridge.h | 37 +++ include/hw/s390x/ap-device.h | 38 +++ include/hw/vfio/vfio-common.h | 1 + linux-headers/asm-s390/kvm.h | 2 + linux-headers/linux/vfio.h | 2 + target/s390x/cpu_features.c | 3 + target/s390x/cpu_features_def.h | 3 + target/s390x/cpu_models.c | 2 + target/s390x/gen-features.c | 3 + target/s390x/kvm.c | 1 + 19 files changed, 1061 insertions(+), 0 deletions(-) create mode 100644 docs/vfio-ap.txt create mode 100644 hw/s390x/ap-bridge.c create mode 100644 hw/s390x/ap-device.c create mode 100644 hw/vfio/ap.c create mode 100644 include/hw/s390x/ap-bridge.h create mode 100644 include/hw/s390x/ap-device.h