From: Guilherme G. Piccoli <hidden> Date: 2017-10-19 19:41:53
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 <redacted>
---
Anju, looks good to you? Tested in P9 with latest FW available.
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Anju T Sudhakar <hidden> Date: 2017-10-24 08:34:59
Hi Guilherme,
Nice catch.
On Friday 20 October 2017 01:11 AM, Guilherme G. Piccoli wrote:
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 <redacted>
Acked-by: Anju T Sudhakar <redacted>
quoted hunk
---
Anju, looks good to you? Tested in P9 with latest FW available.
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Guilherme G. Piccoli <hidden> Date: 2017-10-24 12:18:08
On 10/24/2017 06:34 AM, Anju T Sudhakar wrote:
Hi Guilherme,
Nice catch.
On Friday 20 October 2017 01:11 AM, Guilherme G. Piccoli wrote:
quoted
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 <redacted>
Acked-by: Anju T Sudhakar <redacted>
Thanks Anju :)
quoted
---
Anju, looks good to you? Tested in P9 with latest FW available.
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Michael Ellerman <hidden> Date: 2017-11-01 05:17:42
On Thu, 2017-10-19 at 19:41:33 UTC, "Guilherme G. Piccoli" wrote:
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 <redacted>