From nobody Tue Apr 7 17:13:25 2026 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40D52314A9D for ; Thu, 26 Feb 2026 10:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772103209; cv=none; b=U65pU9EZoPNpFRDT3rTBjkl7CNF0xCvbGJnqyJ2+lgUGxf659gVj0hOzA9DBPRt99Ft4F7efNvb4RT0DvOD3K0WFOgHzRwZwNhSDFhGuykunGHrLba2Y3wrSnkVtRS336tUU/e3PLAlyGg85hPSIIVKggdMzn4TVgf1O6IgmbQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772103209; c=relaxed/simple; bh=iZAvopNpnUSp8+/yBOyqLS2HmMagn7WqUrLvSZbBZ/E=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=SftgZn10HQ2E/62F6KbvrpK920bJgyNADKjRTxBSTbMpzff+pKFPgx8wIOvYXPQ0WpevCRYgxw23xhle2Bjv+0qIDmTV/Ao9ci6T8ziXrreWWyyzK0LM4lgzL7HGmV83OjV/nB9MyvjP/C9S+YxJ4BYskbUa3qIJgh8Aa+opYIo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=lffVtZlE; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="lffVtZlE" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=KvQH2wLFPC/Q9x/NS6J+S3uDco8vVpLpqaLkSX0TmGg=; b=lffVtZlEngxDqajsqaN6HBOyOD fV9vd9TCE8esdd2xkYk96kLLuVGpmKGraFVkgOCIlHYqB/EVAShjIbxbhyfIUd1e75xlG6RdxnRAU lYonP7zfFvrstJHBvWUh5hdf6lLPPn61RT1+hlA12YGJ9fQCYv5Gc8mUNYT11RvSUOCT7Euy8vkRE 72v8jlM7+chdkqU1vP4J1iGkZa/bqWP4uPu4ENDszWaK0SnRtASI9lKHJ3IhblTBHBygyg72fJzOR dIObH490yGLjEUAo90iPsM5yNTXogTeeGuOa+ks67HRtwDhSPzXReSoWEMFqxYaAO8QOFqaoaaDjE X+2rLpww==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vvYzg-0000000AmI7-3Cqr; Thu, 26 Feb 2026 10:53:20 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 0) id 0D56C3032E9; Thu, 26 Feb 2026 11:53:19 +0100 (CET) Message-ID: <20260226105052.248382944@infradead.org> User-Agent: quilt/0.68 Date: Thu, 26 Feb 2026 11:49:10 +0100 From: Peter Zijlstra To: x86@kernel.org, tglx@kernel.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, tim.c.chen@linux.intel.com, yu.c.chen@intel.com, kyle.meyer@hpe.com, vinicius.gomes@intel.com, brgerst@gmail.com, hpa@zytor.com, kprateek.nayak@amd.com, patryk.wlazlyn@linux.intel.com, rafael.j.wysocki@intel.com, russ.anderson@hpe.com, zhao1.liu@intel.com, tony.luck@intel.com Subject: [RFC][PATCH 1/6] x86/topo: Store extra copy of SRAT table References: <20260226104909.675623579@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Because numa_emulate() will wreck the __apicid_to_node[] table, keep an extra copy. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/include/asm/numa.h | 5 +++++ arch/x86/mm/numa.c | 4 ++++ 2 files changed, 9 insertions(+) --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -19,13 +19,18 @@ extern int numa_off; * The mapping may be overridden by apic->numa_cpu_node() on 32bit and thus * should be accessed by the accessors - set_apicid_to_node() and * numa_cpu_node(). + * + * __apicid_to_node[] is affected by numa_emulation(), while + * __apicid_to_phys_node[] is not. */ extern s16 __apicid_to_node[MAX_LOCAL_APIC]; +extern s16 __apicid_to_phys_node[MAX_LOCAL_APIC]; extern nodemask_t numa_nodes_parsed __initdata; =20 static inline void set_apicid_to_node(int apicid, s16 node) { __apicid_to_node[apicid] =3D node; + __apicid_to_phys_node[apicid] =3D node; } =20 extern int numa_cpu_node(int cpu); --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -48,6 +48,10 @@ s16 __apicid_to_node[MAX_LOCAL_APIC] =3D { [0 ... MAX_LOCAL_APIC-1] =3D NUMA_NO_NODE }; =20 +s16 __apicid_to_phys_node[MAX_LOCAL_APIC] =3D { + [0 ... MAX_LOCAL_APIC-1] =3D NUMA_NO_NODE +}; + int numa_cpu_node(int cpu) { u32 apicid =3D early_per_cpu(x86_cpu_to_apicid, cpu);