diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-02-13 22:04:07 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-02-15 22:07:37 +0100 |
commit | 3d41009425225ca5e09016c634ecee513b4713bb (patch) | |
tree | 8294723a70c8414ba2ea66c2ff6b92923e1116b3 /arch/x86/kernel/irq_32.c | |
parent | 92853a7774f942e3692dbd83bace82333a2b47bd (diff) | |
download | lwn-3d41009425225ca5e09016c634ecee513b4713bb.tar.gz lwn-3d41009425225ca5e09016c634ecee513b4713bb.zip |
x86/cpu: Provide a sane leaf 0xb/0x1f parser
detect_extended_topology() along with it's early() variant is a classic
example for duct tape engineering:
- It evaluates an array of subleafs with a boatload of local variables
for the relevant topology levels instead of using an array to save the
enumerated information and propagate it to the right level
- It has no boundary checks for subleafs
- It prevents updating the die_id with a crude workaround instead of
checking for leaf 0xb which does not provide die information.
- It's broken vs. the number of dies evaluation as it uses:
num_processors[DIE_LEVEL] / num_processors[CORE_LEVEL]
which "works" only correctly if there is none of the intermediate
topology levels (MODULE/TILE) enumerated.
There is zero value in trying to "fix" that code as the only proper fix is
to rewrite it from scratch.
Implement a sane parser with proper code documentation, which will be used
for the consolidated topology evaluation in the next step.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Wang Wendy <wendy.wang@intel.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20240212153624.830571770@linutronix.de
Diffstat (limited to 'arch/x86/kernel/irq_32.c')
0 files changed, 0 insertions, 0 deletions