ACK / APPLIED[unstable]: [SRU][Bionic][PATCH 1/1] UBUNTU: SAUCE: powerpc/perf: Fix memory allocation for core-imc based on num_possible_cpus()

Seth Forshee seth.forshee at
Tue May 22 14:18:32 UTC 2018

On Fri, May 18, 2018 at 10:48:03AM -0400, Joseph Salisbury wrote:
> From: Anju T Sudhakar <anju at>
> BugLink:
> Currently memory is allocated for core-imc based on cpu_present_mask, which
>  has bit 'cpu' set iff cpu is populated. We use  (cpu number / threads per core)
>  as as array index to access the memory.  So in a system with guarded cores,
>  since allocation happens based on cpu_present_mask, (cpu number / threads per core)
>  bounds the index and leads to memory overflow.
> The issue is exposed in a guard test.  The guard test will make some CPU's
>  as un-available to the system during boot time as well as at runtime. So
>  when the cpu is unavailable to the system during boot time, the memory
>  allocation happens depending on the number of available cpus. And when we
>  access the memory using (cpu number / threads per core) as the index the
>  system crashes due to memory overflow.
> Allocating memory for core-imc based on cpu_possible_mask, which has bit
>  'cpu' set iff cpu is populatable, will fix this issue.
> Reported-by: Pridhiviraj Paidipeddi <ppaidipe at>
> Signed-off-by: Anju T Sudhakar <anju at>
> Signed-off-by: Joseph Salisbury <joseph.salisbury at>

Acked-by: Seth Forshee <seth.forshee at>

Applied to unstable/master, thanks!

More information about the kernel-team mailing list