From nobody Mon Feb 9 19:42:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.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=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1580136085942334.5330559420023; Mon, 27 Jan 2020 06:41:25 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5ZM-00039T-I9; Mon, 27 Jan 2020 14:40:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iw5ZL-000384-42 for xen-devel@lists.xenproject.org; Mon, 27 Jan 2020 14:40:51 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0302d7e2-4113-11ea-aecd-bc764e2007e4; Mon, 27 Jan 2020 14:40:50 +0000 (UTC) X-Inumbo-ID: 0302d7e2-4113-11ea-aecd-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580136051; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=re8wKPUa0WJZ1jfdK9kaNjyJi81i0wauyu8vDs8BsBc=; b=eakj0HNqS09H1FxmZLtH+hn+UwUX/lAC7+DfInymYu/jAF7/NsAKuym1 XrbmkEeW5Y5rQacVvFkUM6bLZtPcuJzbHne4S1CWCXEhffgvmyMAG4BZ7 h9UajohiPNuwrNRQDmvPPb8iRPoMWxlZAT3Wejv772HTshD/YFpBs/ogm Q=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.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 andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Andrew.Cooper3@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="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@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 (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="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: NSvsbcCY1KsInLzIjJtOPUfe8nbLneMsgrZwbGmlM3lJVZpuaxwXPPGPwdotHEeAv7B9eBay1g Gtsohfo1AcQm87G/D1wDMWRQlJvJTvk/kUAusIYeQB4zvPMQo4aROHKkrjoewpVAxEgvhNeq58 F0iwZ0rfYCKI/lvTjy+fBmii5CKxKWEdnZg9v+S4iadhTOCXiCc8eq0WHFQIiGLJT32oiRpKFc R0K9OZmXRmksIO5YgLaUFt7z1h8TYRVeLpA5OgyOaWAccMJXVYJm96OCvEX9EMi3+8Yk/4SjsH ue4= X-SBRS: 2.7 X-MesageID: 11507064 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.70,370,1574139600"; d="scan'208";a="11507064" From: Andrew Cooper To: Xen-devel Date: Mon, 27 Jan 2020 14:34:38 +0000 Message-ID: <20200127143444.25538-12-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200127143444.25538-1-andrew.cooper3@citrix.com> References: <20200127143444.25538-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 11/17] tools/libxl: Re-position CPUID handling during domain construction 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 , Andrew Cooper , Wei Liu , Ian Jackson 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) CPUID handling needs to be earlier in construction. Move it from its curre= nt position in libxl__build_post() to libxl__build_pre() for fresh builds, and libxl__srm_callout_callback_static_data_done() for the migration/resume cas= e. Later changes will make the migration/resume case conditional on whether CP= UID data was present in the migration stream, and the libxc layer took care of restoring it. No functional change. Signed-off-by: Andrew Cooper Acked-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libxl/libxl_create.c | 8 +++++++- tools/libxl/libxl_dom.c | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 1d2e193509..09f84858d5 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1303,8 +1303,14 @@ int libxl__srm_callout_callback_static_data_done(voi= d *user) libxl__save_helper_state *shs =3D user; libxl__domain_create_state *dcs =3D shs->caller_state; STATE_AO_GC(dcs->ao); + libxl_ctx *ctx =3D libxl__gc_owner(gc); + + const libxl_domain_config *d_config =3D dcs->guest_config; + const libxl_domain_build_info *info =3D &d_config->b_info; =20 - /* Nothing to do (yet). */ + libxl__cpuid_apply_policy(ctx, dcs->guest_domid); + if (info->cpuid !=3D NULL) + libxl__cpuid_set(ctx, dcs->guest_domid, info->cpuid); =20 return 0; } diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 1bac277351..5dc8369eda 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -389,6 +389,18 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, =20 rc =3D libxl__arch_domain_create(gc, d_config, domid); =20 + /* Construct a CPUID policy, but only for brand new domains. Domains + * being migrated-in/restored have CPUID handled during the + * static_data_done() callback. */ + if (!restore) { + /* For x86 at least, libxl_cpuid_apply_policy() takes an implicit + * parameter, HVM_PARAM_PAE_ENABLED, which is only set up in + * libxl__arch_domain_create(). */ + libxl_cpuid_apply_policy(ctx, domid); + if (info->cpuid !=3D NULL) + libxl_cpuid_set(ctx, domid, info->cpuid); + } + return rc; } =20 @@ -456,10 +468,6 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid, if (rc) return rc; =20 - libxl__cpuid_apply_policy(ctx, domid); - if (info->cpuid !=3D NULL) - libxl__cpuid_set(ctx, domid, info->cpuid); - if (info->type =3D=3D LIBXL_DOMAIN_TYPE_HVM && !libxl_ms_vm_genid_is_zero(&info->u.hvm.ms_vm_genid)) { rc =3D libxl__ms_vm_genid_set(gc, domid, --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel