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

Re: [PATCH] x86/cpu: identify uninitialized CPU data using BAD_APICID


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 4 May 2026 15:40:45 +0200
  • 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=T5ZUK99qPY3GpLSFKztsC/WhCwWerXVYqX5C3Giv6Qw=; b=H/BcGYgKUwm9d9e50es6fRiVab8ZpVTwlmKo6P5w9VtONR6A2EpVoZmdwVxA9GEw2m+zlHXGlZkV6h6mSzVi2WiOSJQIoGENmB8Qfo5Ax1UL6XNBr0HRYMy4qQ38FHmbuiNHqxUdxNR38necZrWMq623IgvgBl7JZ10lJC673zsjP4VA0i0xNfAkB5YcBWXA1hCwNMNyvl+4YOBuNqkeH6ruYxa635cOW72PHo5syXXueCyJmonJYxAyJI51tiwoLBIWzn+ExVS5B/30TD5/PUPGVbOCydayEW27cBJ2Llb4vGCJYoCm3JfbjRGdG1tISckNbajCE8melLCCR/0c6Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ScRXDbi23dSU22vcjON62LG2tWaQL8NFfuzpaMTZg3ZHAEehZUGN7SJXXFq3Xxy5c2xl/tu+Yqac+EGk7SRmqIJjqsLLd2fTPWu8YCchSr3LDm/oN5l9EXCDiPnP9Nn5X++o8u7zoWn449lznMbO+cYNHpFt8kSF16nqo/dgSmAge9DIln51PMxACyZVTJG4lK+Sw3XYJyHPmMscTmgRdJt9lDcTeBk+GodY+WTc12NCyQhn3uBjsCRM5g0MstITNOYN2dcdtrbrVv7LFCUMGAGHh+iVXMo2Ez4eWhFuN9hu3vrag7pGDCAUQg38QHSUHjllCUNpWkUQPZOLwrFBeA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 04 May 2026 13:40:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, May 04, 2026 at 01:31:34PM +0200, Jan Beulich wrote:
> On 30.04.2026 13:46, Roger Pau Monne wrote:
> > Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
> > not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
> > correct condition.
> > 
> > Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
> 
> I think this isn't correct, and the issue here is me having overlooked a
> dependency between that commit and the one introducing the line which
> you change: 8c15d3d18725 ("x86/SMP: guard socket_cpumask[] access in
> cpu_smpboot_free()"). Both changes were committed close together, but
> they were entirely separate submissions (well over a year apart). Hence
> as an individual patch that latter commit was correct, but on top of
> 7126b7f806d5 it would have needed adjustment. Since 7126b7f806d5 wasn't
> backported (while 8c15d3d18725 was), the fix here also shouldn't be
> backported to anything earlier than 4.21 (which indeed the Fixes: tag
> better expresses).

I see, right, in the git history 8c15d3d18725 is indeed later than
7126b7f806d5, and hence 7126b7f806d5 was correct when introduced.  The
bug in cpu_smpboot_free() was there, but 7126b7f806d5 made it no
worse.  It was 8c15d3d18725 that would indeed need to be adjusted to
pick up the new initialization value.

Thanks, Roger.



 


Rackspace

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