[PATCH 1/5 Xenial SRU] x86/topology: Fix logical package mapping
tim.gardner at canonical.com
tim.gardner at canonical.com
Fri Apr 15 13:31:26 UTC 2016
From: Peter Zijlstra <peterz at infradead.org>
BugLink: http://bugs.launchpad.net/bugs/1570441
That first branch testing pkg against __max_logical_packages is wrong,
because if the first pkg id is larger, then the find_first_zero will
find us logical package id 0. However, if the second pkg id is indeed
0, we'll again claim it without testing if it was already taken.
Also, it fails to print the mapping.
Fixes: 1f12e32f4cd5 ("x86/topology: Create logical package id")
Reported-by: Xiong Zhou <jencce.kernel at gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz at infradead.org>
Cc: aherrmann at suse.com
Cc: bp at alien8.de
Cc: Mike Galbraith <umgwanakikbuti at gmail.com>
Link: http://lkml.kernel.org/r/20160317095220.GO6344@twins.programming.kicks-ass.net
Link: http://lkml.kernel.org/r/20160318150538.482393396@infradead.org
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
(cherry picked from commit b5d5f27d938fb6fc8d3202704e699d2694a02da6)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
arch/x86/kernel/smpboot.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 9be1a0c..f2a2b70 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -274,11 +274,6 @@ int topology_update_package_map(unsigned int apicid, unsigned int cpu)
if (test_and_set_bit(pkg, physical_package_map))
goto found;
- if (pkg < __max_logical_packages) {
- set_bit(pkg, logical_package_map);
- physical_to_logical_pkg[pkg] = pkg;
- goto found;
- }
new = find_first_zero_bit(logical_package_map, __max_logical_packages);
if (new >= __max_logical_packages) {
physical_to_logical_pkg[pkg] = -1;
--
1.9.1
More information about the kernel-team
mailing list