mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Saurabh Sengar" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Saurabh Sengar <ssengar@linux.microsoft.com>,
	Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/platform] x86/of: Map NUMA node to CPUs as per DeviceTree
Date: Wed, 03 Apr 2024 06:59:51 -0000	[thread overview]
Message-ID: <171212759135.10875.13008794555300700297.tip-bot2@tip-bot2> (raw)
In-Reply-To: <1712068830-4513-4-git-send-email-ssengar@linux.microsoft.com>

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     85900d061884de85f557a06cf56ff69dfae07e26
Gitweb:        https://git.kernel.org/tip/85900d061884de85f557a06cf56ff69dfae07e26
Author:        Saurabh Sengar <ssengar@linux.microsoft.com>
AuthorDate:    Tue, 02 Apr 2024 07:40:29 -07:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 03 Apr 2024 08:49:15 +02:00

x86/of: Map NUMA node to CPUs as per DeviceTree

Currently for DeviceTree bootup, x86 code does the default mapping of
CPUs to NUMA, which is wrong. This can cause incorrect mapping and WARNs
on SMT enabled systems:

  CPU #1's smt-sibling CPU #0 is not on the same node! [node: 1 != 0]. Ignoring dependency.
  WARNING: CPU: 1 PID: 0 at topology_sane.isra.0+0x5c/0x6d
  match_smt+0xf6/0xfc
  set_cpu_sibling_map.cold+0x24f/0x512
  start_secondary+0x5c/0x110

Call the set_apicid_to_node() function in dtb_cpu_setup() for setting
the NUMA to CPU mapping for DeviceTree platforms.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/1712068830-4513-4-git-send-email-ssengar@linux.microsoft.com
---
 arch/x86/kernel/devicetree.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 0d3a50e..b93ce8a 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -24,6 +24,7 @@
 #include <asm/pci_x86.h>
 #include <asm/setup.h>
 #include <asm/i8259.h>
+#include <asm/numa.h>
 #include <asm/prom.h>
 
 __initdata u64 initial_dtb;
@@ -137,6 +138,7 @@ static void __init dtb_cpu_setup(void)
 			continue;
 		}
 		topology_register_apic(apic_id, CPU_ACPIID_INVALID, true);
+		set_apicid_to_node(apic_id, of_node_to_nid(dn));
 	}
 }
 

  reply	other threads:[~2024-04-03  6:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 14:40 [PATCH v2 0/4] Fixing SMP config for DeviceTree platforms Saurabh Sengar
2024-04-02 14:40 ` [PATCH v2 1/4] x86/hyperv/vtl: Correct parse_smp_cfg assignment Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] x86/hyperv/vtl: Correct x86_init.mpparse.parse_smp_cfg assignment tip-bot2 for Saurabh Sengar
2024-04-04 23:58   ` [PATCH v2 1/4] x86/hyperv/vtl: Correct parse_smp_cfg assignment Wei Liu
2024-04-02 14:40 ` [PATCH v2 2/4] x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] " tip-bot2 for Saurabh Sengar
2024-04-02 14:40 ` [PATCH v2 3/4] x86/of: Map NUMA node to CPUs as per DeviceTree Saurabh Sengar
2024-04-03  6:59   ` tip-bot2 for Saurabh Sengar [this message]
2024-04-02 14:40 ` [PATCH v2 4/4] x86/of: Change x86_dtb_parse_smp_config to static Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] x86/of: Change x86_dtb_parse_smp_config() " tip-bot2 for Saurabh Sengar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=171212759135.10875.13008794555300700297.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=ssengar@linux.microsoft.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®