From patchwork Wed Jan 9 12:41:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Morel X-Patchwork-Id: 10754071 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 3915291E for ; Wed, 9 Jan 2019 12:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28C5128E0C for ; Wed, 9 Jan 2019 12:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1962228E0B; Wed, 9 Jan 2019 12:59:56 +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 0FC8428E0B for ; Wed, 9 Jan 2019 12:59:55 +0000 (UTC) Received: from localhost ([127.0.0.1]:59214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghDSc-0007us-Cb for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Jan 2019 07:59:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghDKn-0000Y4-EB for qemu-devel@nongnu.org; Wed, 09 Jan 2019 07:51:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghDAo-0004Ah-3D for qemu-devel@nongnu.org; Wed, 09 Jan 2019 07:41:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38240 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 1ghDAn-0004AP-UU for qemu-devel@nongnu.org; Wed, 09 Jan 2019 07:41:30 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x09CXlHC149887 for ; Wed, 9 Jan 2019 07:41:28 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pwfvr3wp8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 Jan 2019 07:41:28 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Jan 2019 12:41:27 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 9 Jan 2019 12:41:23 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x09CfLSZ59441216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Jan 2019 12:41:21 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A8E94C050; Wed, 9 Jan 2019 12:41:21 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 277D34C046; Wed, 9 Jan 2019 12:41:21 +0000 (GMT) Received: from morel-ThinkPad-W530.boeblingen.de.ibm.com (unknown [9.152.224.140]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 9 Jan 2019 12:41:21 +0000 (GMT) From: Pierre Morel To: walling@linux.ibm.com Date: Wed, 9 Jan 2019 13:41:17 +0100 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 19010912-0020-0000-0000-0000030383E5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010912-0021-0000-0000-00002154998C Message-Id: <1547037680-21458-1-git-send-email-pmorel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-09_07:, , 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=627 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901090106 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH v1 0/3] [RFC] get real IOMMU information from VFIO IOMMU 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: thuth@redhat.com, david@redhat.com, cohuck@redhat.com, qemu-devel@nongnu.org, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In the Z-Architecture, the IOMMU information may change on a device basis. until this patch series we used hardcoded values to define the IOMMU aperture we provide to the guest during PCI enumeration. Let's ask the host about the IOMMU specific configuration using VFIO capabilities. NOTES: 1- You will need the according Linux patch to test this. 2- I am really not happy to add S390 dedicated code in the VFIO common code, as do SPAPR, but I did not find a better solution. Any idea? Pierre Morel (3): vfio: Linux header placeholder vfio/pci: Get real IOMMU information from container s390x/pci: Reporting the host aperture to the guest hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/s390-pci-bus.h | 3 ++ hw/s390x/s390-pci-inst.c | 20 ++++++++++-- hw/vfio/common.c | 75 +++++++++++++++++++++++++++++++++---------- include/hw/vfio/vfio-common.h | 3 ++ linux-headers/linux/vfio.h | 65 +++++++++++++++++++++++++++++++++++-- 6 files changed, 144 insertions(+), 24 deletions(-)