From patchwork Sat Sep 7 00:16:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Rosato X-Patchwork-Id: 1159256 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=209.51.188.17; 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 [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46QFPF5Mj5z9s7T for ; Sat, 7 Sep 2019 10:17:35 +1000 (AEST) Received: from localhost ([::1]:60922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6OPy-0006rx-Jg for incoming@patchwork.ozlabs.org; Fri, 06 Sep 2019 20:17:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42486) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6OPE-0006pF-Bg for qemu-devel@nongnu.org; Fri, 06 Sep 2019 20:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6OPB-0002o7-PK for qemu-devel@nongnu.org; Fri, 06 Sep 2019 20:16:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:11284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i6OP8-0002mx-Gw; Fri, 06 Sep 2019 20:16:39 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8707UMe008833; Fri, 6 Sep 2019 20:16:34 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uuvxg11s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Sep 2019 20:16:34 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8707dlf009183; Fri, 6 Sep 2019 20:16:34 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uuvxg11rq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Sep 2019 20:16:34 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8709N2q011519; Sat, 7 Sep 2019 00:16:33 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 2uqgh82av0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 07 Sep 2019 00:16:33 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x870GVAv46858644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 7 Sep 2019 00:16:31 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7BEAB2064; Sat, 7 Sep 2019 00:16:31 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A5F6B205F; Sat, 7 Sep 2019 00:16:31 +0000 (GMT) Received: from oc4221205838.ibm.com (unknown [9.85.134.207]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 7 Sep 2019 00:16:31 +0000 (GMT) From: Matthew Rosato To: cohuck@redhat.com Date: Fri, 6 Sep 2019 20:16:24 -0400 Message-Id: <1567815389-18229-1-git-send-email-mjrosato@linux.ibm.com> X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-09-06_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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=497 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909070000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v3 0/5] Retrieving zPCI specific info from QEMU 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: walling@linux.ibm.com, alex.williamson@redhat.com, pmorel@linux.ibm.com, david@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Note: These patches by Pierre got lost in the ether a few months back as he has been unavailable to carry them forward. I've made changes based upon comments received on the kernel part of his last version. This patch implement the QEMU part to retrieve ZPCI specific information from the host. The Linux part has been posted on a separate patch on the LKML. Subject: [PATCH v4 0/4] Retrieving zPCI specific info with VFIO We use the PCI VFIO interface to retrieve ZPCI specific information from the host with a ZPCI specific device region. The retrieval is done only once per function and function group during the plugging of the device. The guest's requests are filled with shadow values we keep for the duration of the device remains plugged. Still there are some values we need to virtualize, like the UID and FID of the zPCI function, and we currently only allow the refresh bit for the zPCI group flags. Note that we export the CLP specific definitions in a dedicated file for clarity. Changes since v2: - update vfio_zdev.h to match kernel + fix packing attribute - update vfio.h to match kernel changes Pierre Morel (5): vfio: vfio_iommu_type1: linux header place holder s390: PCI: Creation a header dedicated to PCI CLP s390: vfio_pci: Use a PCI Group structure s390: vfio_pci: Use a PCI Function structure s390: vfio_pci: Get zPCI function info from host hw/s390x/s390-pci-bus.c | 145 +++++++++++++++++++++++++-- hw/s390x/s390-pci-bus.h | 15 ++- hw/s390x/s390-pci-clp.h | 211 ++++++++++++++++++++++++++++++++++++++++ hw/s390x/s390-pci-inst.c | 28 +++--- hw/s390x/s390-pci-inst.h | 196 ------------------------------------- linux-headers/linux/vfio.h | 7 +- linux-headers/linux/vfio_zdev.h | 35 +++++++ 7 files changed, 417 insertions(+), 220 deletions(-) create mode 100644 hw/s390x/s390-pci-clp.h create mode 100644 linux-headers/linux/vfio_zdev.h