From nobody Thu Mar 28 18:35:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1592552020; cv=none; d=zohomail.com; s=zohoarc; b=Ff45BGILe4OUfOBtXAz5mszX9f5fZllVf/V5IIdhirrBZNcOw5P0FTgacUqht/wH684TH5Tv5OgC4YB7xApEoQyOg7+Kml011Ae1pTYUoIVTGbb4wSLLYcyA+YH1f/ZYXMUykrzdXQFsYvhrN9avWElURSYXV9jHoeBUMrlQRFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592552020; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=728HHyIo6p5jd0t/nnpHhhDp0disceXIBDG94ds5xwo=; b=DmkCpI9cgJHG8h/QQVCTBe14bElUussRUhDJRu4Nage3GRC3gaN2/LZGE8bcrWXaQIWpNI7Lx1G5fzfcOwuB1gB3ZQJys0tXIM2b6VSYoa7W4l6G47Ajv12OkPUWfIWTPMa5GuUArQcZpAku0Sw2Zz5HYZcUgAFKBEphi26jzQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1592552019982260.010437738183; Fri, 19 Jun 2020 00:33:39 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jmBWc-0000kX-MT; Fri, 19 Jun 2020 07:33:22 +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.92) (envelope-from ) id 1jmBWb-0000kR-Gw for xen-devel@lists.xenproject.org; Fri, 19 Jun 2020 07:33:21 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 25b6fb4e-b1ff-11ea-bb3e-12813bfff9fa; Fri, 19 Jun 2020 07:33:19 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jmBWY-0000XM-RK; Fri, 19 Jun 2020 07:33:18 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=u2f063a87eabd5f.cbg10.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmBWY-0001QB-He; Fri, 19 Jun 2020 07:33:18 +0000 X-Inumbo-ID: 25b6fb4e-b1ff-11ea-bb3e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=728HHyIo6p5jd0t/nnpHhhDp0disceXIBDG94ds5xwo=; b=itPeCfYxp2CmDQGWUHYz4B4gRO vXX/lAWg1/copLPrIUvzINDNdAtppL9Q16fcrxQ3mRi05sJ6MTqg8YavIjY8XE2Wemfhi1nqQyEJa P7mYvsMnGmqNdveIr2KIn2CS2ZZWttQea+/E0f0MpQb8IRHsPEu+3a5lLplkv7UvhZH0=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH for 4.14] libxl: allow passthrough to PV guests regardless of whether IOMMU is enabled Date: Fri, 19 Jun 2020 08:33:15 +0100 Message-Id: <20200619073315.8414-1-paul@xen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Paul Durrant , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant Commit babde47a "introduce a 'passthrough' configuration option to xl.cfg..= ." added a check to xl_parse.c:parse_config_data() to make sure that an IOMMU was present and enabled in the system before allowing devices to be passed through to a guest. This check was then subsequently moved into libxl_create.c:libxl__domain_config_setdefault() by commit ad011ad0 "libxl/= xl: Overhaul passthrough setting logic". Prior to this check being added, it was possible (although not in any way s= afe or supported) to pass devices through to a PV guest without an IOMMU being enabled in the system. This patch relaxes the check for PV guests to restore that possibility, emitting a warning instead. Signed-off-by: Paul Durrant Reviewed-by: Ian Jackson --- Cc: Ian Jackson Cc: Wei Liu A Cc: Anthony PERARD This patch ought to be in 4.14 as it as very obvious change, restoring lost functionality that has affected a user. --- tools/libxl/libxl_create.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 2814818e34..f1d17cfb87 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1104,10 +1104,14 @@ int libxl__domain_config_setdefault(libxl__gc *gc, =20 bool iommu_enabled =3D physinfo.cap_hvm_directio; if (c_info->passthrough !=3D LIBXL_PASSTHROUGH_DISABLED && !iommu_enab= led) { - LOGD(ERROR, domid, - "passthrough not supported on this platform\n"); - ret =3D ERROR_INVAL; - goto error_out; + if (c_info->type !=3D LIBXL_DOMAIN_TYPE_PV) { + LOGD(ERROR, domid, + "passthrough not supported on this platform\n"); + ret =3D ERROR_INVAL; + goto error_out; + } + LOGD(WARN, domid, + "passthrough is enabled but IOMMU is not present/enabled\n"); } =20 if (c_info->passthrough =3D=3D LIBXL_PASSTHROUGH_DISABLED && need_pt) { --=20 2.20.1