From patchwork Wed Jul 17 01:00:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 11046863 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 6D62614F6 for ; Wed, 17 Jul 2019 01:03:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCAD28606 for ; Wed, 17 Jul 2019 01:03:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5102628724; Wed, 17 Jul 2019 01:03:44 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4C6028606 for ; Wed, 17 Jul 2019 01:03:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnYK2-00054R-1H; Wed, 17 Jul 2019 01:01:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hnYK0-000542-9A for xen-devel@lists.xenproject.org; Wed, 17 Jul 2019 01:01:28 +0000 X-Inumbo-ID: 65db98f0-a82e-11e9-9acd-679cd0efb6fa Received: from new3-smtp.messagingengine.com (unknown [66.111.4.229]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 65db98f0-a82e-11e9-9acd-679cd0efb6fa; Wed, 17 Jul 2019 01:01:24 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 6586C22C5; Tue, 16 Jul 2019 21:01:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 16 Jul 2019 21:01:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=KfbX31 HzPuJRwZjCOc99cvHJdumaNPTN5XOi8sXY5wU=; b=nBiYT0aofiE8DBZZDz0sYg MrcFXraVfL0GPH9d/9VbncsRB7m+f5tKyE9KMF6CnwLkv02u6JAp2mDleAf1jX3f wTdZ5uA6/O1Nqi4YuWmI/x12UlfS8OC2b1iOT+e1Rx6aSTHtWmOvH0XBbrNftxYV fMs9kuuRTmFv2ELUelO6wz/RjplAgS/di2L0PAL1mCR0JANusjbdeBotWl48FbSH nwCjkh0+QVY/TQW2zWd2NuRszo4FkrxINjRBnFAulvvpaq0eJNcVXjdoaHrlR63E GLaZ7gn5XVEi+UsIh8JXw71RaQlW8PnOelZJM+rxiqKf7+RiFTACcyqu+5Qzl2NQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddriedugdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddqiedmnecujfgurhephffvufffkffogggtgfesthekredtredtjeen ucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomh grrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuffho mhgrihhnpehquhgsvghsqdhoshdrohhrghenucfkphepledurdeihedrfeegrdeffeenuc frrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhh ihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id 344B6380086; Tue, 16 Jul 2019 21:01:19 -0400 (EDT) From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 17 Jul 2019 03:00:38 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 0/6] Fix PCI passthrough for HVM with stubdomain X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian , Stefano Stabellini , Suravee Suthikulpanit , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Tim Deegan , Julien Grall , Jan Beulich , Anthony PERARD , Daniel De Graaf , Brian Woods , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP In this version, I add PHYSDEVOP_msi_control to allow stubdomain enabling MSI after mapping it. Related article: https://www.qubes-os.org/news/2017/10/18/msi-support/ Changes in v2: - new "xen/x86: Allow stubdom access to irq created for msi" patch - applied review comments from v1 Changes is v3: - apply suggestions by Roger - add PHYSDEVOP_msi_msix_set_enable Changes in v4: - implement suggestions by Wei, Roger, Jan - plug new physdevop into XSM Changes in v5: - rebase on master - rename to PHYSDEVOP_msi_control - move granting access to IRQ into create_irq --- Cc: Ian Jackson Cc: Wei Liu Cc: Andrew Cooper Cc: George Dunlap Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Anthony PERARD Cc: "Roger Pau Monné" Cc: Suravee Suthikulpanit Cc: Brian Woods Cc: Kevin Tian Cc: Daniel De Graaf Marek Marczykowski-Górecki (6): libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use libxl: attach PCI device to qemu only after setting pciback/pcifront libxl: don't try to manipulate json config for stubdomain xen/x86: Allow stubdom access to irq created for msi. xen/x86: add PHYSDEVOP_msi_control tools/libxc: add wrapper for PHYSDEVOP_msi_control tools/libxc/include/xenctrl.h | 6 ++- tools/libxc/xc_physdev.c | 19 ++++++++- tools/libxl/libxl_pci.c | 63 +++++++++++++++++-------- xen/arch/x86/hpet.c | 3 +- xen/arch/x86/irq.c | 51 ++++++++++++++------ xen/arch/x86/msi.c | 42 +++++++++++++++++- xen/arch/x86/physdev.c | 25 ++++++++++- xen/arch/x86/x86_64/physdev.c | 4 ++- xen/common/irq.c | 1 +- xen/drivers/char/ns16550.c | 2 +- xen/drivers/passthrough/amd/iommu_init.c | 2 +- xen/drivers/passthrough/pci.c | 3 +- xen/drivers/passthrough/vtd/iommu.c | 3 +- xen/include/asm-x86/irq.h | 2 +- xen/include/asm-x86/msi.h | 1 +- xen/include/public/physdev.h | 16 ++++++- xen/include/xen/irq.h | 1 +- xen/include/xlat.lst | 1 +- xen/include/xsm/dummy.h | 7 +++- xen/include/xsm/xsm.h | 6 ++- xen/xsm/dummy.c | 1 +- xen/xsm/flask/hooks.c | 24 ++++++++++- xen/xsm/flask/policy/access_vectors | 1 +- 23 files changed, 246 insertions(+), 38 deletions(-) base-commit: b541287c3600713feaaaf7608cd405e7b2e4efd0