From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, Guenter Roeck <linux@roeck-us.net>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: [patch 2/4] x86/topology: Dont evaluate logical IDs during early boot
Date: Fri, 22 Mar 2024 19:56:36 +0100 (CET) [thread overview]
Message-ID: <20240322185305.186943142@linutronix.de> (raw)
In-Reply-To: <20240322184944.141421692@linutronix.de>
The local APICs have not yet been enumerated so the logical ID evaluation
from the topology bitmaps does not work and would return an error code.
Skip the evaluation during the early boot CPUID evaluation and only apply
it on the final run.
Fixes: 380414be78bf ("x86/cpu/topology: Use topology logical mapping mechanism")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/cpu/topology_common.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--- a/arch/x86/kernel/cpu/topology_common.c
+++ b/arch/x86/kernel/cpu/topology_common.c
@@ -140,7 +140,7 @@ static void parse_topology(struct topo_s
}
}
-static void topo_set_ids(struct topo_scan *tscan)
+static void topo_set_ids(struct topo_scan *tscan, bool early)
{
struct cpuinfo_x86 *c = tscan->c;
u32 apicid = c->topo.apicid;
@@ -148,8 +148,10 @@ static void topo_set_ids(struct topo_sca
c->topo.pkg_id = topo_shift_apicid(apicid, TOPO_PKG_DOMAIN);
c->topo.die_id = topo_shift_apicid(apicid, TOPO_DIE_DOMAIN);
- c->topo.logical_pkg_id = topology_get_logical_id(apicid, TOPO_PKG_DOMAIN);
- c->topo.logical_die_id = topology_get_logical_id(apicid, TOPO_DIE_DOMAIN);
+ if (!early) {
+ c->topo.logical_pkg_id = topology_get_logical_id(apicid, TOPO_PKG_DOMAIN);
+ c->topo.logical_die_id = topology_get_logical_id(apicid, TOPO_DIE_DOMAIN);
+ }
/* Package relative core ID */
c->topo.core_id = (apicid & topo_domain_mask(TOPO_PKG_DOMAIN)) >>
@@ -187,7 +189,7 @@ void cpu_parse_topology(struct cpuinfo_x
tscan.dom_shifts[dom], x86_topo_system.dom_shifts[dom]);
}
- topo_set_ids(&tscan);
+ topo_set_ids(&tscan, false);
}
void __init cpu_init_topology(struct cpuinfo_x86 *c)
@@ -208,7 +210,7 @@ void __init cpu_init_topology(struct cpu
x86_topo_system.dom_size[dom] = 1U << sft;
}
- topo_set_ids(&tscan);
+ topo_set_ids(&tscan, true);
/*
* AMD systems have Nodes per package which cannot be mapped to
next prev parent reply other threads:[~2024-03-22 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 18:56 [patch 0/4] x86/topology: Cure fallout Thomas Gleixner
2024-03-22 18:56 ` [patch 1/4] x86/cpu: Ensure that CPU info updates are propagated on UP Thomas Gleixner
2024-03-22 21:41 ` Guenter Roeck
2024-03-23 13:24 ` [tip: x86/urgent] " tip-bot2 for Thomas Gleixner
2024-03-22 18:56 ` Thomas Gleixner [this message]
2024-03-22 21:41 ` [patch 2/4] x86/topology: Dont evaluate logical IDs during early boot Guenter Roeck
2024-03-23 13:24 ` [tip: x86/urgent] x86/topology: Don't " tip-bot2 for Thomas Gleixner
2024-03-22 18:56 ` [patch 3/4] x86/topology: Handle the !APIC case gracefully Thomas Gleixner
2024-03-22 21:41 ` Guenter Roeck
2024-03-23 13:24 ` [tip: x86/urgent] " tip-bot2 for Thomas Gleixner
2024-03-22 18:56 ` [patch 4/4] x86/mpparse: Register APIC address only once Thomas Gleixner
2024-03-22 21:41 ` Guenter Roeck
2024-03-23 13:24 ` [tip: x86/urgent] " tip-bot2 for Thomas Gleixner
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=20240322185305.186943142@linutronix.de \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=torvalds@linux-foundation.org \
--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®