From nobody Mon Feb 9 20:59:10 2026 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; dmarc=fail(p=none dis=none) header.from=eu.citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1572276671; cv=none; d=zoho.com; s=zohoarc; b=lYJS20l4tgrvEN54Tkj7LvaHg3ZMC6UZWsvoqUKJWxUgW7wZCxPpsJefbdfT7MqBOnb/+vkfGb55DOJwu1JtiSbBReT5G0RBuYDaU547wqYSN6a8e7SCGlJJgDrxp2tUbYJAs8vfHGfTmpxDsgEl73Lh219LnXfIQlTgx3/YQ6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572276671; 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; bh=SroF0CQcrj6GEgzpJ+mQ4r1xqTQjV4vUwGxuv/qrDDo=; b=dMYGn5ADj1/VmxVGoAbNDOn9EGS8WcuTAKpdEgzfOv+x3rdxBP4MWps/l0fI27lMQbwzLn7uO0reF0aqO/WT38JOn09BP5PBxg1i4fgYSKf1k4QTjs61/gNeBrC8PpwBe8X2WlfvgWpexbEDE43El/jRPtf0hTRvyowpSQKDR5Y= 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157227667180252.807730190303005; Mon, 28 Oct 2019 08:31:11 -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 1iP6y2-0000sA-Rh; Mon, 28 Oct 2019 15:30:02 +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 1iP6y1-0000l0-B2 for xen-devel@lists.xenproject.org; Mon, 28 Oct 2019 15:30:01 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cb8a5db7-f997-11e9-94fa-12813bfff9fa; Mon, 28 Oct 2019 15:29:58 +0000 (UTC) X-Inumbo-ID: cb8a5db7-f997-11e9-94fa-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1572276597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=idJQT3dktdNr+6Mag+/V/3wjPRaVFe12y8JOuZZZUos=; b=FCTgXqYEA1fVa9+FSDmIKBoymZKJt9smMPof2ovDqarJeD8FHOhZ0Koh FmHFYFttRRaZXR6B2ieIsa/HQkaBBDSwRmyXCDu2r7k2wDkFJtyYjoteQ 2QxyksBWSNsMnHWQMxMWiigVoRwCtgbYakscB+Ac2t6F1t3SZ9EGM25kW o=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@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 (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@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 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: GFNlsme9IerX1hz02cgERN8bwuDz1zN+8goe6K64zfWVWZ0Lgn9OmLspZhBoZ9mneJipruquU9 3cCbknRy/YQndCk+zzOwoU3I/eySOsye0bmVfpLjidsuqtOqIip/P+Cz3nwCyerfo9aa2hcuOg CkfW4p8OO1j0cOcwA5qqOHkEWK+4vGr1eQUtMy6f+sLOGIwIMX2hiXJteBNlMDFYGmdGHNlODi w8YjOI+x4wsmMrn11DFtB0/Ynd9u7O7Y/B1WlD9ajUl86HLaT4xwlGvSOzOOCqLwdDxaDO8gth oek= X-SBRS: 2.7 X-MesageID: 7826419 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.68,240,1569297600"; d="scan'208";a="7826419" From: Ian Jackson To: Date: Mon, 28 Oct 2019 15:29:47 +0000 Message-ID: <20191028152948.11900-3-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20191028152948.11900-1-ian.jackson@eu.citrix.com> References: <20191028152948.11900-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [XEN PATCH for-4.13 2/3] libxl: libxl__spawn_stub_dm: Call domain_config_setdefault 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 , =?UTF-8?q?J=C3=BCrgen=20Gro=C3=9F?= , 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) Previously, defaulting and checking of some aspects of the domain config was skipped for stub dms. This has been the case forever. In ad011ad08843 "libxl/xl: Overhaul passthrough setting logic" some defaulting that was needed for stub dms was moved from libxl__domain_create_info_setdefault to .._config_setdefault with the result that for stub dms, libxl__domain_make fails with this assertion: xl: libxl_create.c:582: libxl__domain_make: Assertion `info->passthrough !=3D LIBXL_PASSTHROUGH_DEFAULT' failed. Fix this by properly doing all defaulting and all checking for stub dms. This is more correct, but (especially at this stage of the release) it is necessary to more closely evaluate the effects by reviewing the body of _config_setdefault. The changes are as follows: One actual functional change: * The new passthrough defaulting is properly done. This is what we are trying to actually fix here. And a lot of things that make no difference: * shadow_memkb would now be set. Whether this would be correct is not entirely clear. It seems better to make this patch (whose purpose is to fix the passthrough defaulting) *not* include that semantic change, so here I have included a hunk to explicitly override this. * FLASK ssid_label is processed. But the actual ssidref is copied from the guest domain by spawn_stub_dm, and ssid_label is set to NULL. So no change. * We set iommu_memkb. But to 0 since passthrough is disabled. * cpuid pool_name is processed. But this is not set by spawn_stub_dm. (Arguably this is a bug: stub dms should inherit the parent cpupool.) The effect is to leave poolid set to 0 and call libxl_cpupoolid_is_valid but that always succeeds for 0. So no change. * Various extra checks are done: reject PCI passthrough for HVM with POD (stub dm is PV); reject pod + vnuma, or PV + vnuma (stub dm has no vnuma); reject nested HVM or pod, with alt2pm-hvm (again, stub dm is PV). So these checks will always pass. Signed-off-by: Ian Jackson CC: Juergen Gross Reviewed-by: Anthony PERARD --- tools/libxl/libxl_dm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index e6a48974f8..7e52f09731 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -2141,6 +2141,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stu= b_dm_spawn_state *sdss) libxl_domain_build_info_init(&dm_config->b_info); libxl_domain_build_info_init_type(&dm_config->b_info, LIBXL_DOMAIN_TYP= E_PV); =20 + dm_config->b_info.shadow_memkb =3D 0; dm_config->b_info.max_vcpus =3D 1; dm_config->b_info.max_memkb =3D 28 * 1024 + guest_config->b_info.video_memkb; @@ -2167,14 +2168,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__st= ub_dm_spawn_state *sdss) dm_config->c_info.run_hotplug_scripts =3D guest_config->c_info.run_hotplug_scripts; =20 - libxl_physinfo physinfo; - ret =3D libxl_get_physinfo(CTX, &physinfo); - if (ret) goto out; - - ret =3D libxl__domain_create_info_setdefault(gc, &dm_config->c_info, - &physinfo); - if (ret) goto out; - ret =3D libxl__domain_build_info_setdefault(gc, &dm_config->b_info); + ret =3D libxl__domain_config_setdefault(gc, dm_config, guest_domid); if (ret) goto out; =20 if (libxl_defbool_val(guest_config->b_info.u.hvm.vnc.enable) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel