From patchwork Tue Oct 18 01:53:31 2016 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: 9381085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6943D6086B for ; Tue, 18 Oct 2016 01:59:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 522CA28CB7 for ; Tue, 18 Oct 2016 01:59:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45E7728CD7; Tue, 18 Oct 2016 01:59:58 +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=-4.2 required=2.0 tests=BAYES_00, 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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F037728CDF for ; Tue, 18 Oct 2016 01:59:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwJem-0002tA-18; Tue, 18 Oct 2016 01:57:32 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwJel-0002sl-5T for xen-devel@lists.xen.org; Tue, 18 Oct 2016 01:57:31 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 55/16-28857-A8185085; Tue, 18 Oct 2016 01:57:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRWlGSWpSXmKPExsVykCGBTbezkTX C4OVbLYslHxezODB6HN39mymAMYo1My8pvyKBNaNxyQvGgu+cFQff9jA1MH5g72Lk4hASmMAo 8WXaUqYuRk4OCQEdiS+THoHZQgK7GSV616ZA2PkSfS9eMoPYbAKhEu3bZ7CC2CIC0hLXPl9mB BnELHCOUaJlfitYQljAUWLT8+tAGzg4WARUJX7+VwUJ8wr4SZy5e5EVYpecxLYtexhBbE4Bf4 nNq5+wQuzyk1h0aRcbRL2gxMmZT1hAxjALqEusnycEEuYXUJLYtv4yWCuzgLxE89bZzBMYBWc h6ZiF0DELSdUCRuZVjOrFqUVlqUW65npJRZnpGSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmb GIEBywAEOxhnXvY/xCjJwaQkyjuviDVCiC8pP6UyI7E4I76oNCe1+BCjDAeHkgTv/HqgnGBRa npqRVpmDjB2YNISHDxKIry3QdK8xQWJucWZ6RCpU4yKUuK8Ug1ACQGQREZpHlwbLF4vMcpKCf MyAh0ixFOQWpSbWYIq/4pRnINRSZj3Pch4nsy8Erjpr4AWMwEtPpfHArK4JBEhJdXAaM/0z0O O+ZZ/9vtF/TPPpa7WZV13eXHF8RPH8sSnr5nk4HFI8qnWac29P2/HyD7kt/yrd7xo1SvGqzte zKnK3N/DH/ou9Gn67dDDbrpPVPefvKIWeO2EGI/aMvEzDH8b6mY2sF5QNWiomM1xcOck96yqF U9YX6+ect9m94y5UsrTHOo7jxRz6SmxFGckGmoxFxUnAgAuexl40gIAAA== X-Env-Sender: marmarek@mimuw.edu.pl X-Msg-Ref: server-9.tower-27.messagelabs.com!1476755849!65919947!1 X-Originating-IP: [193.0.96.6] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21715 invoked from network); 18 Oct 2016 01:57:29 -0000 Received: from mail.mimuw.edu.pl (HELO mail.mimuw.edu.pl) (193.0.96.6) by server-9.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 18 Oct 2016 01:57:29 -0000 Received: from localhost (localhost [127.0.0.1]) by duch.mimuw.edu.pl (Postfix) with ESMTP id 7E936238; Tue, 18 Oct 2016 03:57:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at mimuw.edu.pl Received: from mail.mimuw.edu.pl ([193.0.96.6]) by localhost (mail.mimuw.edu.pl [127.0.0.1]) (amavisd-new, port 10028) with ESMTP id Q5SHj5hpNr4B; Tue, 18 Oct 2016 03:57:26 +0200 (CEST) Received: by duch.mimuw.edu.pl (Postfix, from userid 1575) id B77C8209; Tue, 18 Oct 2016 03:57:26 +0200 (CEST) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xen.org Date: Tue, 18 Oct 2016 03:53:31 +0200 Message-Id: <1476755613-3921-2-git-send-email-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1476755613-3921-1-git-send-email-marmarek@invisiblethingslab.com> References: <1476755613-3921-1-git-send-email-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Organization: Invisible Things Lab Cc: Wei Liu , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Samuel Thibault Subject: [Xen-devel] [PATCH 1/3] libxl: attach xen-pciback only to PV domains X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP HVM domains use IOMMU and device model assistance for communicating with PCI devices, xen-pcifront/pciback is used only in PV domains. When HVM domain has device model in stubdomain, attaching xen-pciback to the target domain itself is not only useless, but also may prevent attaching xen-pciback to the stubdomain, effectively breaking PCI passthrough. Signed-off-by: Marek Marczykowski-Górecki --- tools/libxl/libxl_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 6f8f49c..2ae1bc4 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1111,7 +1111,7 @@ out: } } - if (!starting) + if (!starting && !hvm) rc = libxl__device_pci_add_xenstore(gc, domid, pcidev, starting); else rc = 0; @@ -1306,7 +1306,8 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl__ao *ao, uint32_t domid, } } - if (d_config->num_pcidevs > 0) { + if (d_config->num_pcidevs > 0 + && d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV) { rc = libxl__create_pci_backend(gc, domid, d_config->pcidevs, d_config->num_pcidevs); if (rc < 0) {