From nobody Tue Nov 11 08:30:41 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569379379; cv=none; d=zoho.com; s=zohoarc; b=ejhcCZYPdIjK/EW2XnQdWQdnlSdNhmSTMzR6eANoKJHqHw7d/OzbBk6DcrHtxzfKzG7Y8gwWwJ6rUuTiJ5gPR8VMToXvXI/ZMzvI7nrvcBkHOxO8xMfxF5XxQa5UiDud1tPRsbh78r4q/bNO4f7Cb0leqmKOv2dRoXAkKscLE1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569379379; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=R+UVJs2te9z5XzM/+5pfPii11UGrcbIgYnKdPoO8NbE=; b=OcMaNAxFlgVdikUBqNKj3HwTM7XR2Ewvo9YNJny7GkYJ/dCda8oGwDDWUyBNijxwXpTGMJq9xxBOyhOCho2VYGerhTOepNcbV7CeMeAcdRhFcyzEI53b9i+lEi3nt/CX7v2c5sYtqz8sOvP3GddIqoiFHZByK7BGqRRuPKqi9zQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569379379451426.8670398925501; Tue, 24 Sep 2019 19:42:59 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCxFJ-0000sm-QL; Wed, 25 Sep 2019 02:41:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCxFI-0000sc-5M for xen-devel@lists.xenproject.org; Wed, 25 Sep 2019 02:41:36 +0000 Received: from out2-smtp.messagingengine.com (unknown [66.111.4.26]) by localhost (Halon) with ESMTPS id fdc62ae0-df3d-11e9-bf31-bc764e2007e4; Wed, 25 Sep 2019 02:41:35 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2FC252222B; Tue, 24 Sep 2019 22:41:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 24 Sep 2019 22:41:35 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id AA369D6005E; Tue, 24 Sep 2019 22:41:33 -0400 (EDT) X-Inumbo-ID: fdc62ae0-df3d-11e9-bf31-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=jYpAjnlE+xFbalsg2q3WrQQg+q42vr+5BpmVq4v5g 5Q=; b=iHRIbzbaXTs40euYMt/wQSEQN4QJW6ZNvRP7c9Q3s+IDlSbB7fHq7gsWL MAExL9AenZmX1JB5dx1w5j5jxX3PJh/mJlBCtAEhE49EgPDKR7QwogrzXJEyKFgt hOjH9/hhoDvHXnoO1dpeHAxm3KNgj1JXwBq2prbiqv/kLZmy6D+Rk+mGLKyaFAPA Kc1tKTKtqHVafN66slkk8Hr0DwxcceCC+xZCjUNYj4ZcCXmkvMzFxVT9i4HqD5oY nV+bg2r/j6AFhLoFJU8GWeRrw7Dx7Wgt+UFiqhESP4sNWJzUpqpYeTNvK0At5YT2 2yZotfYfJgDkDwmdXxi7tmudBexsA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrfedugdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdef feenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslh gvthhhihhnghhslhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Wed, 25 Sep 2019 04:41:23 +0200 Message-Id: <0d3f56a22a7f01024d0d83ed83028b37648f6a30.1569379186.git-series.marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v7 1/4] libxl: do not attach xen-pciback to HVM domain, if stubdomain is in use 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: Anthony PERARD , Ian Jackson , Wei Liu , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" HVM domains use IOMMU and device model assistance for communicating with PCI devices, xen-pcifront/pciback isn't directly needed by HVM domain. But pciback serve also second function - it reset the device when it is deassigned from the guest and for this reason pciback needs to be used with HVM domain too. When HVM domain has device model in stubdomain, attaching xen-pciback to the target domain itself may prevent attaching xen-pciback to the (PV) stubdomain, effectively breaking PCI passthrough. Fix this by attaching pciback only to one domain: if PV stubdomain is in use, let it be stubdomain (the commit prevents attaching device to target HVM in this case); otherwise, attach it to the target domain. Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu --- Changes in v2: - previously called "libxl: attach xen-pciback only to PV domains" - instead of excluding all HVMs, change the condition to what actually matters here - check if stubdomain is in use; this way xen-pciback is always in use (either for the target domain, or it's stubdomain), fixing PCI reset by xen-pciback concerns Changes in v3: - adjust commit message --- tools/libxl/libxl_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 03beb86..2e06a45 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1106,7 +1106,7 @@ out: } } =20 - if (!starting) + if (!starting && !libxl_get_stubdom_id(CTX, domid)) rc =3D libxl__device_pci_add_xenstore(gc, domid, pcidev, starting); else rc =3D 0; @@ -1302,7 +1302,7 @@ static void libxl__add_pcidevs(libxl__egc *egc, libxl= __ao *ao, uint32_t domid, } } =20 - if (d_config->num_pcidevs > 0) { + if (d_config->num_pcidevs > 0 && !libxl_get_stubdom_id(CTX, domid)) { rc =3D libxl__create_pci_backend(gc, domid, d_config->pcidevs, d_config->num_pcidevs); if (rc < 0) { --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel