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

Re: [PATCH v3 1/1] xen/arm: fix sparse cpu_possible_map calculation on SMP boot


  • To: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Thu, 2 Jul 2026 09:13:03 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=valinux.co.jp smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=yj42o5dQa5WI3bb6qW20n8gTFcCUFB1Aw2r8frAqhX8=; b=rprn7nqeCfTgl/hqJ2Ukj+3lpEFbTQwyCAPjGcbZn6lzszcVMLIOWyb8vrWt+4EaA2V2i8Kyamt2gcTCbY90zU7uEZ+elPseUXCY31eDrbamsCpF7SCD34TmAMA4qJHAUk8tSJUAYI2m1yRt2CdpwPi0iQQZSc5HVBwVPyNtAYdjqoxxEEdO53UmtdVrG9S0OzaZkAIU+IkUNudHAcuyAz/x9D5uQK58eH81Leiwg8J3dyfE8Wma7GyUmnKZ4ILiTbIhQSjKHMIzvyJ+/sxNaVp0nJ/kBX4qGScxpF7P+3OcJebXzkKQNFToTwngtbLqgB65Pq+6rzcBNUw1rIgM+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hMoAy8u7BjAKeSDM3ibSBizL1Bb7b2FjZR6fh/YnBM9R+t4d9fQM4/0jSxbpaHnaf5gZBfR9knA2sapJUCQweowgCzP0Wc5IcSEwEby+7KTO0ybhcgbsh3S+aVYnzqdFVeiNy6s+5qIbVPMMAbofQBImCxFZqHk4Rs2uTWHDsEd8CyB992BhwJ41OEuZFVWn6XpC75EmvLjaLSiJdnUl5LiCeHJZobhmYyrdgnvHC5dJ0Bi55EzO/Gv77qTzWoU4PU/CSOFQd7Ls4eC23lE8GOOz4JpDOetrgqQ+XG82QNulNLCBSJm36cLkuGum2Ta0NIfUyHMUNpa29sd/EraHMQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 02 Jul 2026 07:13:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 02-Jul-26 00:40, Hirokazu Takahashi wrote:
> Currently, during ARM Xen's SMP initialization, if there is
> a Device Tree error (such as an invalid 'enable-method'),
> cpu_possible_map can end up being sparse.
> 
> The issue here is that nr_cpu_ids is calculated in a way that
> doesn't properly account for the maximum CPU ID when the map is
> sparse, causing a mismatch. For example, if cpu_possible_map is
> 0xff0f, nr_cpu_ids becomes 12, but the actual maximum CPU ID
> is 15. Xen's common code is built on the assumption that
> 'CPU ID < nr_cpu_ids', so this mismatch can break things.
> 
> To fix this, modify dt_smp_init_cpus() so that if the
> arch_cpu_init() call fails, we don't consume the CPU ID slot.
> 
> Fixes: 4557c2292854 ("xen: arm: rewrite start of day page table and cpu bring 
> up")
> Signed-off-by: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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