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

Re: [PATCH] x86/S3: restore MCE (APs) and add MTRR (BSP) init


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 23 Mar 2026 12:16:39 +0100
  • 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=xAUfQ8s+1FGN6f2MApaLd8d/AGOLqbmY+xkVDnQuE4Q=; b=G3XVkBiG6aoo2IL0ryfefvgMfDx2FCWKn+24m7wtYY1Mnr5glwv5AR5LojA2TzSNK58jacTCDIS8xCN8wnjExdOMEhE1u/T9rhhWUgdeIlynoH5OHHAaqO7ayyd7gK0vBIFXUR+gufpmF3jLG7wQ3G35S1Qed8zqG4KQ2XKJQa9puXphi6QM5c1zHdqRMJ2ElQhj1BzDoxeB/mew3+WA/3R9usi5WtzFKmuf5Hat5ACCBNhJxNns85rv50zvf3rEnJMTV0pePTOAhG8Jec8mHfSzUVkhi6AXzzAX4AtWk5Olji8pjp5770aXTYQLcCNMKrG0XMi21StY6lJxvGJVYA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OTsgLp5VlSz8eHreozwGWQSNbBe+MbIKFTF3VsdbcsiLQ8PIZHfxaPedoF31+Oi+NzI8Pr8z3LQOMWQKQm/JYu3pkIUA/aTSm0ihc4+yt6OmMLxLslaCKJWOm1s1rntKbKVBfvYY0rG68nbodpNe/XCvtX7i37b+CljjfkacK+IoHxyHT7NGbNXp15KU1bF9S7nWMAh00qxISPGu7AP/sQ/t6UgmhVhWt1JqKQ7TALnCtjaY9XguQ36FEVfzJc+RKES1jQaDYI9Oz9XvJHltieLlKgaqKnnCYhlx8NDiW8BKuXn3fE3DYfjacHz0MTdj3+gAzWdT47rLmWVyiLBiJw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 23 Mar 2026 11:16:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Mar 04, 2026 at 02:39:01PM +0100, Jan Beulich wrote:
> MCE init for APs was broken when CPU feature re-checking was added. MTRR
> (re)init for the BSP looks to never have been there on the resume path.

I'm not sure the statement about MTRR init is correct, AFAICT
mtrr_aps_sync_end() will also re-init the MTRRs on the BSP, and hence
the added mtrr_ap_init() seems to duplicate what's already done in
mtrr_aps_sync_end().

> Fixes: bb502a8ca592 ("x86: check feature flags after resume")
> Reported-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Sadly we need to go by CPU number (zero vs non-zero) here. See the call
> site of recheck_cpu_features() in enter_state().
> 
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -642,16 +642,21 @@ void identify_cpu(struct cpuinfo_x86 *c)
>                              smp_processor_id());
>       }
>  
> -     if (system_state == SYS_STATE_resume)
> -             return;
> +     if (system_state == SYS_STATE_resume) {
> +             unsigned int cpu = smp_processor_id();
>  
> +             if (cpu)
> +                     mcheck_init(&cpu_data[cpu], false);
> +             else /* Yes, the BSP needs to use the AP function here. */
> +                     mtrr_ap_init();

For symmetry with the BSP path, is it really needed to init MCE so
early for the BSP by calling it directly in enter_state(), or could it
also be done here?

Thanks, Roger.



 


Rackspace

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