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

Re: [PATCH 2/4] x86/MCE: restrict allocation of thermal and CMCI vector to BSP


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 20 Nov 2025 11:51:26 +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=sLDy/hNapsmpu1OpM9WWzd1VD35jURq8F+6HLtaztI8=; b=njcQStlz677iotuhV267CqRkiLcrGCxC6prIhGF1+5I5K/ih3JWhRqD0p9ITAeEjp38tnHVuX8opSyR3De0lFh7CmwahdzGav3hkliKygh1RPiR/Y7SrgN5fYCT08HyFzXnPdnXx/Jzj1czFldbBxv/Cj5Q0MK2sbmjl7qpbjDaAfB8e/VxgI2AwmO8v3aAabLgGe5pg4HS8d6i8zKbn/b/X/KF+MWXM1WTz5ZzUSz+Dc+DfD7pRFtAXChX9YQ7Rz6TkAyx7GytqwQ8X/rYZb70O22vPQCUrB4ZY3h+xFJpaD+Cgu7KSL5j6kxfZHxb1vDTg9vh2ok8LeWw+boPe3w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lcpfkAbCuc1Pk7d899DjKfnbBDE+lJqj0HS6/NtX9Pa50pzqoLMT4tNJljGetM5bqZFNAAhErlbnMvLrnyauR81VGIjQKLAKuRsoFcks5GxG7E72c8ziXnx9uuWOJzyewva820o+i69KQM19ssKo+nZ0OlC8H0ZrI0wIMIRrbHdpQack5HQcjE2bVQODZDzQ5pS1BpgvcD9Jhjb/miIFDWU5Jn7kUCaLRgpL+8+oLyBpsk6knOmowA17Y/7W52V/oZqOJ+LS4P7WnNdOPI6mUysFachBPI9jUnU3Li0N5FK31b+N45Ao8fwy+c/PV6B6IFVhsNhzLYUb3zoLo6vP+g==
  • 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: Thu, 20 Nov 2025 11:51:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/11/2025 10:50 am, Jan Beulich wrote:
> --- a/xen/arch/x86/cpu/mcheck/mce.c
> +++ b/xen/arch/x86/cpu/mcheck/mce.c
> @@ -110,13 +110,13 @@ static void __init mcheck_intel_therm_in
>  }
>  
>  /* P4/Xeon Thermal regulation detect and init */
> -static void intel_init_thermal(struct cpuinfo_x86 *c)
> +static void intel_init_thermal(const struct cpuinfo_x86 *c, bool bsp)
>  {
>      uint64_t msr_content;
>      uint32_t val;
>      int tm2 = 0;
>      unsigned int cpu = smp_processor_id();
> -    static uint8_t thermal_apic_vector;
> +    static uint8_t __ro_after_init thermal_apic_vector;
>  
>      if ( !intel_thermal_supported(c) )
>          return; /* -ENODEV */
> @@ -160,7 +160,8 @@ static void intel_init_thermal(struct cp
>          return; /* -EBUSY */
>      }
>  
> -    alloc_direct_apic_vector(&thermal_apic_vector, intel_thermal_interrupt);
> +    if ( bsp )
> +        alloc_direct_apic_vector(&thermal_apic_vector, 
> intel_thermal_interrupt);

We really don't want both c and bsp passed in.  That can only go wrong.

Furthermore, this function has 2 other examples generating bsp locally.

The function is in desperate need of cleanup (MSRs, variable and
constant names), but right now this makes it worse.

Please either use c == &boot_cpu_data, and I'll do some cleanup later,
or generate bsp = c == &boot_cpu_data and fix up all users in the function.

~Andrew



 


Rackspace

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