From: Anju T Sudhakar <hidden> Date: 2018-05-11 13:43:57
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
---
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Michael Neuling <hidden> Date: 2018-05-11 23:45:37
On Fri, 2018-05-11 at 19:13 +0530, Anju T Sudhakar wrote:
Currently memory is allocated for core-imc based on cpu_present_mask, whi=
ch
has
bit 'cpu' set iff cpu is populated. We use (cpu number / threads per cor=
e)
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 le=
ads
to memory overflow.
=20
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 avail=
able
cpus. And when we access the memory using (cpu number / threads per core)=
as
the
index the system crashes due to memory overflow.
=20
Allocating memory for core-imc based on cpu_possible_mask, which has
bit 'cpu' set iff cpu is populatable, will fix this issue.
=20
Reported-by: Pridhiviraj Paidipeddi <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
On Fri, May 11, 2018 at 11:43 PM, Anju T Sudhakar
[off-list ref] wrote:
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
---
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The changelog does not clearly call out the confusion between present
and possible.
Guarded CPUs are possible but not present, so it blows a hole when we assume the
max length of our allocation is driven by our max present cpus, where
as one of the cpus
might be online and be beyond the max present cpus, due to the hole..
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Balbir Singh.
On Saturday 12 May 2018 05:15 AM, Michael Neuling wrote:
On Fri, 2018-05-11 at 19:13 +0530, Anju T Sudhakar wrote:
quoted
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
Thanks, this should be:
Cc: <redacted> # 4.14
Thanks for marking to stable. But it should go to 4.14+ stable releases.
Maddy
From: Anju T Sudhakar <hidden> Date: 2018-05-14 08:33:49
Hi,
On Saturday 12 May 2018 06:05 AM, Balbir Singh wrote:
On Fri, May 11, 2018 at 11:43 PM, Anju T Sudhakar
[off-list ref] wrote:
quoted
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
---
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The changelog does not clearly call out the confusion between present
and possible.
Guarded CPUs are possible but not present, so it blows a hole when we assume the
max length of our allocation is driven by our max present cpus, where
as one of the cpus
might be online and be beyond the max present cpus, due to the hole..
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Balbir Singh.
Thanks for the review.
OK. I will update the commit message here.
Regards,
Anju
From: Anju T Sudhakar <hidden> Date: 2018-05-14 08:36:40
On Friday 11 May 2018 07:13 PM, Anju T Sudhakar wrote:
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-05-14 10:49:22
Anju T Sudhakar [off-list ref] writes:
On Saturday 12 May 2018 06:05 AM, Balbir Singh wrote:
quoted
On Fri, May 11, 2018 at 11:43 PM, Anju T Sudhakar
[off-list ref] wrote:
quoted
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 <redacted>
Signed-off-by: Anju T Sudhakar <redacted>
---
arch/powerpc/perf/imc-pmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The changelog does not clearly call out the confusion between present
and possible.
Guarded CPUs are possible but not present, so it blows a hole when we assume the
max length of our allocation is driven by our max present cpus, where
as one of the cpus
might be online and be beyond the max present cpus, due to the hole..
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Thanks for the review.
OK. I will update the commit message here.
Yeah please do. "Guarded" CPUs is also not a well understand term, so
please explain what that means for people who don't know.
cheers