Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22432EDB7DF for ; Tue, 7 Apr 2026 10:04:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1274787.1560777 (Exim 4.92) (envelope-from ) id 1wA3I4-00010A-Kd; Tue, 07 Apr 2026 10:04:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1274787.1560777; Tue, 07 Apr 2026 10:04:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wA3I4-000103-Hj; Tue, 07 Apr 2026 10:04:12 +0000 Received: by outflank-mailman (input) for mailman id 1274787; Tue, 07 Apr 2026 10:04:10 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wA3I2-0000zx-Pq for xen-devel@lists.xenproject.org; Tue, 07 Apr 2026 10:04:10 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wA3I2-004oas-5L for xen-devel@lists.xenproject.org; Tue, 07 Apr 2026 12:04:10 +0200 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69d4d699-5cb7-0a2a0a5109dd-0a2a450cede4-2 for ; Tue, 07 Apr 2026 12:04:10 +0200 Received: from [103.168.172.152] (helo=fhigh-a1-smtp.messagingengine.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.56.0) (envelope-from ) id 69d4d699-f40c-0a2a450c0019-67a8ac989a81-3 for ; Tue, 07 Apr 2026 12:04:10 +0200 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id F24ED1400034; Tue, 7 Apr 2026 06:04:08 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 07 Apr 2026 06:04:08 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Apr 2026 06:04:07 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1775556248; x=1775642648; bh=Nh4qJ5MqF9xl0Ctu8zGw5G2TJN1cNUVOeabiaHX1EFI=; b= htR/Ijjpdv2NrFKA+fYLwqeaSa1HMYk6RCuvcPCDxj7kzuc/ApZc54umjOVGwkOA 3HZ4O6btShbhpjeygIVFVHft8fVQ4ErYRsl44uQk9Cv4XY0jQEddAhmuxfCio1CM D5OOqXH1iN50IDse2jyCg3Uf5gWR0NMfytSBM2sJMWcDMebkkPN4ONVbL8ywrIag rs3jti4P55meLHFSNm0gST0ifk49Mahm0Vn7mtQLwWviEvS75C8QnNHS8NIpWtrt zBwk3h4DdMFoJSHALM6AgcW5tFpyvTA1V4dwn0GTLLSqvNxHZViN+k0CHxzrVjON 92T/s3sh9zONwTs0c3hjLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775556248; x=1775642648; bh=Nh4qJ5MqF9xl0Ctu8zGw5G2TJN1cNUVOeab iaHX1EFI=; b=CvJTKSz1NgekoDbnQ/ctFw+G1poOegr3mHFEl7FyC8zSictISav bweNdtit55oAQ5PjzT9yKzyGTTjT1q+xQ+oFLGq6m5dxOMGCu3Wq6QFwjUNr09Dj +1FBBLRBeDVrUFPQhQjzGvPqmBMDSFSfoXDpGDbJw4VuWSs+RkMoHtrgIwqOvmmi C831Ll9NL7Fn+5cnWfBFXvPhkTtak9nyW9bysw35dBwnH7b42WPvi25gf2A3v/cg cn0Yho2qqOGUbDThyjkZqZgImfLRAkpq3A8D5mOobOwTa9Q8OM32G8cNpArhiidq fSWkAOfVNTaKesPRGwgvOsTJU1drjpzy+2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvtdefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghkucfo rghrtgiihihkohifshhkihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefgkedutdffteethfeiueehffek ueffledvffdutdetteeltdevkeefkeelheejgfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvght hhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehjsggvuhhlihgthhesshhushgvrdgtohhmpdhrtghpthhtohep gigvnhdquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpth htoheprghnughrvgifrdgtohhophgvrhefsegtihhtrhhigidrtghomhdprhgtphhtthho pehrohhgvghrrdhprghusegtihhtrhhigidrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Date: Tue, 7 Apr 2026 12:04:05 +0200 From: Marek Marczykowski To: Jan Beulich Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= Subject: Re: [PATCH] x86/cpu-policy: set up host policy earlier Message-ID: References: <6dccae5f-fe09-4f35-9e4a-7a38fb21e8d1@suse.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cjd2LFgO4eOZHcdQ" Content-Disposition: inline In-Reply-To: <6dccae5f-fe09-4f35-9e4a-7a38fb21e8d1@suse.com> X-purgate-ID: tlsNG-d25034/1775556250-81557A3D-F6E7FC3D/0/0 X-purgate-type: clean X-purgate-size: 3613 --cjd2LFgO4eOZHcdQ Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 7 Apr 2026 12:04:05 +0200 From: Marek Marczykowski To: Jan Beulich Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , Roger Pau =?utf-8?B?TW9ubsOp?= Subject: Re: [PATCH] x86/cpu-policy: set up host policy earlier On Tue, Apr 07, 2026 at 08:46:39AM +0200, Jan Beulich wrote: > In order to use cpu_has_* expanding to host_cpu_policy.*, the host policy > needs setting up alongside boot_cpu_data.x86_capability[]. Arrange for > that towards the end of identify_cpu(). >=20 > Fixes: 894bd7617924 ("x86/Intel: use host CPU policy for ARAT checking") > Reported-by: Marek Marczykowski-G=C3=B3recki > Signed-off-by: Jan Beulich Tested-by: Marek Marczykowski-G=C3=B3recki > --- > In the longer run we may need to (also) update the host policy from > setup_{force,clear}_cpu_cap(). >=20 > This really was part of one of the XSTATE cleanup patches at the head of > the AMX series. This explains the specific placement ahead of the call to > xstate_init()). Likely anything from there downwards shouldn't really > live in identify_cpu() anyway. >=20 > --- a/xen/arch/x86/cpu/common.c > +++ b/xen/arch/x86/cpu/common.c > @@ -586,6 +586,8 @@ void identify_cpu(struct cpuinfo_x86 *c) > } > =20 > /* Now the feature flags better reflect actual CPU features! */ > + if (c =3D=3D &boot_cpu_data) > + calculate_host_policy(); > =20 > xstate_init(c); > =20 > --- a/xen/arch/x86/cpu-policy.c > +++ b/xen/arch/x86/cpu-policy.c > @@ -359,7 +359,7 @@ void calculate_raw_cpu_policy(void) > /* Was already added by probe_cpuid_faulting() */ > } > =20 > -static void __init calculate_host_policy(void) > +void __init calculate_host_policy(void) > { > struct cpu_policy *p =3D &host_cpu_policy; > unsigned int max_extd_leaf; > @@ -904,6 +904,7 @@ static void __init calculate_hvm_def_pol > =20 > void __init init_guest_cpu_policies(void) > { > + /* Do this a 2nd time to account for setup_{clear,force}_cpu_cap() u= ses. */ > calculate_host_policy(); > =20 > if ( IS_ENABLED(CONFIG_PV) ) > --- a/xen/arch/x86/include/asm/cpu-policy.h > +++ b/xen/arch/x86/include/asm/cpu-policy.h > @@ -30,4 +30,10 @@ void recalculate_cpuid_policy(struct dom > */ > void calculate_raw_cpu_policy(void); > =20 > +/* > + * Collect the host CPU policy. Called after collecting enough CPUID ou= tput, > + * and again after all feature overrides have been put in place. > + */ > +void calculate_host_policy(void); > + > #endif /* X86_CPU_POLICY_H */ --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab --cjd2LFgO4eOZHcdQ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmnU1pUACgkQ24/THMrX 1yyRNwf5AaCNJWlZelP3p1Zxxjnvpi55wsCFEkSrysaDmsxbUr+X7cNNEPo9mv/p g4f4OzfIuHPj7CRdJmBFaJhi2xD/dwjZ7c+3o5yDUVF6nBJi87NQouCARg3nEobF Te3QbhCI72hDOfei6W2KIydS3EEWJDBRYCjvvIj7Ol0JuF4vGcckQBi9EFJ3txZp wiXnBvw1mAVL1NTNrcN+geaUeksthzA9TVlPx4ZxX4pVzv8R8/GKwI1s4xlLuqQA JWeU8Ggy8SuESpvxsQ54ivntWx7da2Z3y4++y47bs4p8qXjEooNLtzEPPDhgPVOO rlHtqaNELadnG5C0iovEUF+xg/p07g== =kwlA -----END PGP SIGNATURE----- --cjd2LFgO4eOZHcdQ--