From patchwork Thu Jan 24 10:12:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Knut Omang X-Patchwork-Id: 10778663 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 9955B139A for ; Thu, 24 Jan 2019 10:25:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 884B02E455 for ; Thu, 24 Jan 2019 10:25:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C4672E6EC; Thu, 24 Jan 2019 10:25:25 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY 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 26C6A2E455 for ; Thu, 24 Jan 2019 10:25:25 +0000 (UTC) Received: from localhost ([127.0.0.1]:50725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmcCK-0006gu-BV for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Jan 2019 05:25:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmc84-0002nl-Mw for qemu-devel@nongnu.org; Thu, 24 Jan 2019 05:21:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmc24-0005l9-Tc for qemu-devel@nongnu.org; Thu, 24 Jan 2019 05:14:50 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:46846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmc22-0005RE-Uf for qemu-devel@nongnu.org; Thu, 24 Jan 2019 05:14:48 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0OAECwn012997; Thu, 24 Jan 2019 10:14:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2018-07-02; bh=4ccDn1wnPf4SBi/I9Mh8ETWGsnLJ8sDWAVvKOkrBGu8=; b=lwNc/UBYej6NfKE1gC3++CvfWDErwoSnWurWDtws7m4Qs+w5REz8Qo/hhUcIp/BMlGPX 1eEtGq3w/11uQebKyUW1AvyoZWdUSmnZKKf2e04dJKQyubQhO/EM6q4XXk16DsKkvFVw KAmn9YSWiP1fe3JqcgtyC7vS360YbqtJnqfzaL91KgD0iK6JI6yXHSsEwzGnLdCAfEQ7 zhnx1xGCgX4OG30OWyocqZcjpDV8eddR68oDCAIlWm+GzhM8Jp/c3oy4NCR91POzukih /l4QsG2wdb/VbWNkd8G4t3zkWjgDslSeae3MrdozuYOVrUqmaq347TsRA4LtF9jOTbPg gQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2q3vhrxva6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Jan 2019 10:14:34 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0OAEXgB011887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Jan 2019 10:14:34 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0OAEXKN011115; Thu, 24 Jan 2019 10:14:33 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Jan 2019 02:14:32 -0800 From: Knut Omang To: qemu-devel@nongnu.org Date: Thu, 24 Jan 2019 11:12:51 +0100 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9145 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=789 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901240076 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH v2 0/2] pcie: Add simple ACS "support" to the generic PCIe root port 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: "Michael S . Tsirkin" , Tal Attaly , Elijah Shakkour , Knut Omang , Alex Williamson , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP These two patches together implements a PCIe capability config space header for Access Control Services (ACS) for the new Qemu specific generic root port. ACS support in the associated root port is a prerequisite to be able to pass individual functions of a device populating the port through to an L2 guest from an unmodified kernel. Without this, the IOMMU group the device belongs to will also include the root port itself, and all functions the device provides. It is necessary to support SR/IOV where the primary purpose is to be able to share out individual VFs to different guests, which will not be permitted by VFIO or the Windows Hyper-V equivalent unless ACS is supported by the root port. These patches can also be found as part of an updated version of my SR/IOV emulation patch set at https://github.com/knuto/qemu/tree/sriov_patches_v10 Changes from v1: ---------------- Incorporated feedback from Alex Williamson: - Make commit messages reflect a more correct understanding of how this affects VFIO operation. - Implemented the CTRL register properly (reset callback + making non-implemented capabilities RO, default value 0) - removed the egress ctrl vector parameter to the init function - Fixed some whitespace issues Knut Omang (2): pcie: Add a simple PCIe ACS (Access Control Services) helper function gen_pcie_root_port: Add ACS (Access Control Services) capability hw/pci-bridge/gen_pcie_root_port.c | 2 ++ hw/pci-bridge/pcie_root_port.c | 4 ++++ hw/pci/pcie.c | 21 +++++++++++++++++++++ include/hw/pci/pcie.h | 6 ++++++ include/hw/pci/pcie_port.h | 1 + include/hw/pci/pcie_regs.h | 4 ++++ 6 files changed, 38 insertions(+) base-commit: a8d2b0685681e2f291faaa501efbbd76875f8ec8