[Skiboot] [PATCH] core/cpu: Fix memory allocation for job array

Nicholas Piggin npiggin at gmail.com
Mon Sep 3 15:46:28 AEST 2018


On Sun,  2 Sep 2018 15:29:09 +0530
Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com> wrote:

> fixes: 7a3f307e core/cpu: parallelise global CPU register setting jobs
> 
> This bug would result in boot-hang on some configurations due to
> cpu_wait_job() endlessly waiting for the last bogus jobs[cpu->pir] pointer.

Dang, good catch, so *that's* what the bug was. You'd better
fix my broken cpu_cleanup_all as well.

Reviewed-by: Nicholas Piggin <npiggin at gmail.com>

Thanks,
Nick



> 
> Reported-by: Stephanie Swanson <swanman at us.ibm.com>
> Reported-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> Signed-off-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
> ---
>  core/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/cpu.c b/core/cpu.c
> index 88477f82..cc5fba32 100644
> --- a/core/cpu.c
> +++ b/core/cpu.c
> @@ -1373,7 +1373,7 @@ static int64_t cpu_change_all_hid0(struct hid0_change_req *req)
>  	struct cpu_thread *cpu;
>  	struct cpu_job **jobs;
>  
> -	jobs = zalloc(sizeof(struct cpu_job *) * cpu_max_pir + 1);
> +	jobs = zalloc(sizeof(struct cpu_job *) * (cpu_max_pir + 1));
>  	assert(jobs);
>  
>  	for_each_available_cpu(cpu) {
> -- 
> 2.17.1
> 



More information about the Skiboot mailing list