diff options
author | Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> | 2017-10-19 21:41:33 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-10-25 12:41:13 +0200 |
commit | 0b167f11085a34281349f395d200052b61a7e221 (patch) | |
tree | 323931d5300107fae8ed66a354f3051b6b0b3131 /arch/c6x | |
parent | powerpc/perf: Fix IMC initialization crash (diff) | |
download | linux-0b167f11085a34281349f395d200052b61a7e221.tar.xz linux-0b167f11085a34281349f395d200052b61a7e221.zip |
powerpc/perf: Fix IMC allocation routine
When setting nr_cpus=1, we observed a crash in IMC code during boot
due to a missing allocation: basically, IMC code is taking the number
of threads into account in imc_mem_init() and if we manually set
nr_cpus for a value that is not multiple of the number of threads per
core, an integer division in that function will discard the decimal
portion, leading IMC to not allocate one mem_info struct. This causes
a NULL pointer dereference later, on is_core_imc_mem_inited().
This patch just rounds that division up, fixing the bug.
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Acked-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/c6x')
0 files changed, 0 insertions, 0 deletions