aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJan Stancek <jstancek@redhat.com>2015-03-31 12:11:46 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2015-03-31 21:05:44 -0400
commitd52356e7f48e400ca258c6763a232a92fa82ff68 (patch)
tree21d37003d5904a22276e2fe845aecd88580ad8e7 /arch
parente42391cd048809d903291d07f86ed3934ce138e9 (diff)
powerpc: fix memory corruption by pnv_alloc_idle_core_states
Space allocated for paca is based off nr_cpu_ids, but pnv_alloc_idle_core_states() iterates paca with cpu_nr_cores()*threads_per_core, which is using NR_CPUS. This causes pnv_alloc_idle_core_states() to write over memory, which is outside of paca array and may later lead to various panics. Fixes: 7cba160ad789 (powernv/cpuidle: Redesign idle states management) Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/cputhreads.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/cputhreads.h b/arch/powerpc/include/asm/cputhreads.h
index 2bf8e9307be9..4c8ad592ae33 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -55,7 +55,7 @@ static inline cpumask_t cpu_thread_mask_to_cores(const struct cpumask *threads)
55 55
56static inline int cpu_nr_cores(void) 56static inline int cpu_nr_cores(void)
57{ 57{
58 return NR_CPUS >> threads_shift; 58 return nr_cpu_ids >> threads_shift;
59} 59}
60 60
61static inline cpumask_t cpu_online_cores_map(void) 61static inline cpumask_t cpu_online_cores_map(void)