diff options
author | Artem Fetishev <artem_fetishev@epam.com> | 2014-03-28 16:33:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-28 16:56:58 -0400 |
commit | 825600c0f20e595daaa7a6dd8970f84fa2a2ee57 (patch) | |
tree | ae739547c15bb979d412c6eced02796310b04afb /arch | |
parent | d9060742fbf630fe31951dfc10b798deb2813f01 (diff) |
x86: fix boot on uniprocessor systems
On x86 uniprocessor systems topology_physical_package_id() returns -1
which causes rapl_cpu_prepare() to leave rapl_pmu variable uninitialized
which leads to GPF in rapl_pmu_init().
See arch/x86/kernel/cpu/perf_event_intel_rapl.c.
It turns out that physical_package_id and core_id can actually be
retreived for uniprocessor systems too. Enabling them also fixes
rapl_pmu code.
Signed-off-by: Artem Fetishev <artem_fetishev@epam.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/topology.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index d35f24e231cd..1306d117967d 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
@@ -119,9 +119,10 @@ static inline void setup_node_to_cpumask_map(void) { } | |||
119 | 119 | ||
120 | extern const struct cpumask *cpu_coregroup_mask(int cpu); | 120 | extern const struct cpumask *cpu_coregroup_mask(int cpu); |
121 | 121 | ||
122 | #ifdef ENABLE_TOPO_DEFINES | ||
123 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) | 122 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) |
124 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) | 123 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) |
124 | |||
125 | #ifdef ENABLE_TOPO_DEFINES | ||
125 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) | 126 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
126 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) | 127 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
127 | #endif | 128 | #endif |