From nobody Tue Nov 11 05:43:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1569921211; cv=none; d=zoho.com; s=zohoarc; b=i1P4X0BrB3ftWsjh7b4NyQKXCkRqwKBSH1V/T+ZLVTRkAqiaBEm/9FlVk+IPmUmIuUs9oR2i82NZ2lKPk95UBKbF0lRU/fK9bP/Y3Xh8FoBlFICrQPwm+/WyWB6/boGxsNtxXVYAGER72ASdIPYbt4ZN0bzxI8PbTKzG3zGEZE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569921211; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=FxcwesjZjr+rO3hHIurHiyzaoQWqO236rW4zB7PqDRU=; b=iH3Sv/Hnma9TXGDkkkB1o+hkQSQDJ1PCOh/DyZhmiX0IAHtjpr6nBg8yeC8YvODdkWGnst7sbSyz7bYcVGRNYp8atfRwAxrpvl0we+bfA/Hlrdw6qIy0UG3eGb+6DCh5PmBqDiTixwLKFIbcB7rvSJ/5VGGulfoiNZFOiF0qjME= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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 156992121100611.455707528557127; Tue, 1 Oct 2019 02:13:31 -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 1iFECi-0004FD-Ui; Tue, 01 Oct 2019 09:12:20 +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 1iFECi-0004F6-7y for xen-devel@lists.xenproject.org; Tue, 01 Oct 2019 09:12:20 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by localhost (Halon) with ESMTPS id 90fe7ffb-e42b-11e9-96f6-12813bfff9fa; Tue, 01 Oct 2019 09:12:19 +0000 (UTC) X-Inumbo-ID: 90fe7ffb-e42b-11e9-96f6-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1569921140; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Fuqos8FL1CuT4r9A4knatA4mZaGfXspr1OwtKlMT21w=; b=afiIUeYwZxSU6cdC7nqeDNu2kkKXUCs9UZKa0sPauRtu15Zk4QBN2+Xz xCluIrv/9WmJHGqnJ1IhO4SIfDHkM8QSbh/EUShTWFhoWL1OaOq00N+F1 ZXAz5ULAGLchGSd9xXAj+rPASG/PeWwJIA3Yx9knEGYLV2y98xELMGW1o o=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com 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; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: fSQgL098U1Cd4QVGjSZQNOmFlrHot04JxdYnBYlvzvvUmcB7M2plJTntMMdhGSRj9VE56NZzY1 ZMGd3ocFTpYfDH1lFxpIk76/AbUtUmKV2HUNaycrE9Vv+Iynz7D4zswJvVl2semhd3Zc8dEhy3 yUZ5t/uFl5cmeKRDeCWMWBGpH5vddWoXQ+7JZJpUNBhuUIbmBL/cZUn9MiNNc6Ht7x8khOkqlB RyEgBNvnPPgao64LS/EKkH/tOzRwocKCU2+6DoApOZUZhJhRGu50D0LcQ/xel62vbxRkgFKTct pnU= X-SBRS: 2.7 X-MesageID: 6295631 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,570,1559534400"; d="scan'208";a="6295631" From: Paul Durrant To: Date: Tue, 1 Oct 2019 10:12:14 +0100 Message-ID: <20191001091214.3287-1-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH-for-4.13] libxl: choose an appropriate default for passthrough... 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 , Juergen Gross , Paul Durrant , Ian Jackson , 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" X-ZohoMail-DKIM: fail (Header signature does not verify) ...if there is no IOMMU or it is globally disabled. Without this patch, the following assertion may be hit: xl: libxl_create.c:589: libxl__domain_make: Assertion `info->passthrough != =3D LIBXL_PASSTHROUGH_ENABLED' failed. This is because libxl__domain_create_info_setdefault() currently only sets an appropriate value for 'passthrough' in the case that 'cap_hvm_directio' is true, which is not the case unless an IOMMU is present and enabled in the system. This is normally masked by xl choosing a default value, but that will not happen if xl is not used (e.g. when using libvirt) or when a stub domain is being created. Signed-off-by: Paul Durrant --- Cc: Ian Jackson Cc: Wei Liu Cc: Anthony PERARD Cc: Juergen Gross --- tools/libxl/libxl_create.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index b58e030376..3bdb6c51b6 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -68,7 +68,11 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc, c_info->passthrough =3D ((c_info->type =3D=3D LIBXL_DOMAIN_TYPE_PV= ) || !info.cap_iommu_hap_pt_share) ? LIBXL_PASSTHROUGH_SYNC_PT : LIBXL_PASSTHROUGH_SHARE_PT; - } + } else if (!info.cap_hvm_directio) + c_info->passthrough =3D LIBXL_PASSTHROUGH_DISABLED; + + /* An explicit setting should now have been chosen */ + assert(c_info->passthrough !=3D LIBXL_PASSTHROUGH_ENABLED); =20 return 0; } --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel