[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 6/8] x86/Intel: use host CPU policy for ARAT checking


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 18 Nov 2025 19:42:28 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y7us3+rDzc8EVNdKmlUwZMDntOWgubbA+JKPaclBEaQ=; b=RIBE1Sog9/vWG5S3Xr66hJjsvCla8plXMMkQWpKaiz1dQS8VtMZgnX2q8dvqa9XiZx1eSC1IeUr1G8aUDWLRmnORP1bDI5DJXgTgB52yFmynqWUws/XMlSHpVnobTs0rO2gC5IrkeOt0oi1NHJC+tXmtCVPfqXgz07PCKYJMbo6jyGe/sc21deBL0EGG4kIUJa7ELumW16rO/NG+aRfkcqcuh0pFPYQxaI+wo6cyrN2X3fBkPfV3fS7eu5UBmnjWwQjimaXDia4CosxWCxVYmRUKVG7Ldk/fpIH3rZHUy0d9wZoC+tMqsneMTw/YRnqEEw1PuoDdif4GO4ywdA+xPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gZrAxy5sO1FnxnFcWcdbpTIuvd/PI9KkeJmc4osCEr+5iWVY6McVatIlZqIXI8r6X2j2Rih7Mnv/o6xOcXTKKeMgIa0sWIAj9D56OJm3GE70xymdbYFfGMF/6/iJnUFaoRHBZvJI42uf5y7t19gLY/tddhK6PrEye/CduIWK259eRqzxiVQFk5S9DypuAowiiTMu2sgUTGdp7dN9zHeKHwIH8CCGuwNYiH/k8u/5d/HsQadpA3k60eNT21s3rAUsdKjTV8uZCd0oW/mHN/bnWHBGmsgKHZwu1oxr5lVoWtxWw2pjZUEbIH4AxwvBBMBLwgZbRJ0nCe985apaIpJOQA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 18 Nov 2025 19:42:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18/11/2025 3:08 pm, Jan Beulich wrote:
> There's no need to invoke CPUID yet another time. However, as the host CPU
> policy is set up only shortly after init_intel() ran on the BSP, defer the
> logic to a pre-SMP initcall. This can't be (a new) one in cpu/intel.c
> though, as that's linked after acpi/cpu_idle.c (which is where we already
> need the feature set). Since opt_arat is local to the cpu/ subtree,
> introduce a new Intel-specific helper to hold the code needed.
>
> Further, as we assume symmetry anyway, use setup_force_cpu_cap() and hence
> limit the checking to the boot CPU.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> The need to move where cpu_has_arat is checked would go away if we did
> away with opt_arat (as mentioned in the previous patch), and hence could
> use cpu_has_arat directly where right now XEN_ARAT is checked.
>
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -1666,6 +1666,9 @@ static int __init cf_check cpuidle_presm
>  {
>      void *cpu = (void *)(long)smp_processor_id();
>  
> +    if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
> +        intel_init_arat();

I really would prefer to avoid the need for this.

Now that microcode loading has moved to the start of day, we can drop
most of the order-of-init complexity for CPUID/etc, and I expect that
problems like this will cease to exist as a result.

Notably, we've now got no relevant difference between early_init() and
regular init().  That was a complexity we inherited from Linux.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.