[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:43:35 +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=VNTTuv1mIpdoaYibkk8uRhnxo36W+PtBnwkguQRH78s=; b=TIVBUoQYyWtszcsf8okVIkgC5hicYx0zzv1ue/cCT96J24y16HYmSZUX7BgRAb/ze9xrcAlC694P0bGpEkO2Kazl91OLmM+gPBNLqcOh1T57kDPVq9G50W4g87MXz2yxSfFfD+CkyZaTQ9rM+o9byvwYbO1OYyEFrokLNR0MIJuCJxPNBMEDZT9Djoz98EdCDUNasY6urAjNJ4HYxE3wBTUunrzSYieqfPj6ZHSb0Cm8ay4+sYxJokBQIJIr/z3LXCgb1wihQxpwS/eYK+jvQ8cvVa/BUdlMDz4YzjBVZUUVTeK3PGFFUndRe0qUQ6E0mkWLAEhm1pLWRwMkJXQHWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zCNHQLzJ34zBcMFuFyWqV0d+SUJqVVnyqsYOAmIidsr5Hlg/9NomcuQW9eHm1Rn4wUgEZT8Iolg3BN+xXM7RQpHOvIf+YCSHuQUVTHPaJHtXVUqDtO/Rzpsux0Pa0gwhItiewTRs/6MzV4V80mav5/chdS3sCITJYisvxQSDqrxZr5i/Nt8ebH5ArE7eDGXivIPaA90U28IeTit1ljgsOc8lv1ZKKC0sn3kh8CgKscpunZTHxK1dxkRBCGzudEP+DOQ6Eihw9ss8p7gV3zr5zvG8ffrVoTrkPEn2t9DMR2ShGH+va4kKDxdOhlbZqUxApmhWN6XdsTwnzZpb1abMlQ==
  • 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:43:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Mar 23, 2026 at 12:38:48PM +0100, Jan Beulich wrote:
> On 23.03.2026 12:16, Roger Pau Monné wrote:
> > 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().
> 
> Hmm, right you are. Had I been asked, I would have confirmed that I checked
> the code past the "enable_cpu" label, but clearly I must not have, or I was
> blind at that time. Let me strip that out.
> 
> >> --- 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?
> 
> To be honest, I would put the question the other way around: Is it really
> okay to do it this late for APs (during boot also for the BSP [1])? Iirc
> an #MC prior to mcheck_init() is going to be deadly to the system. Moving
> it earlier may, however, be a more intrusive change.

We might want to at least add a note to document this asymmetric
initialization between the BSP and the APs at least?

I would be perfectly happy with moving this earlier, and it needs to
be consistent between the APs and the BSP.

Thanks, Roger.



 


Rackspace

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