-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Avoid using per cpu array for ordered booting
Currently both order booting and spinwait approach uses a per cpu array to update stack & task pointer. This approach will not work for the following cases. 1. If NR_CPUs are configured to be less than highest hart id. 2. A platform has sparse hartid. This issue can be fixed for ordered booting as the booting cpu brings up one cpu at a time using SBI HSM extension which has opaque parameter that is unused until now. Introduce a common secondary boot data structure that can store the stack and task pointer. Secondary harts will use this data while booting up to setup the sp & tp. Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Atish Patra <atishp@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
- Loading branch information
Atish Patra
authored and
Palmer Dabbelt
committed
Jan 20, 2022
1 parent
3938d5a
commit 9a2451f
Showing
4 changed files
with
58 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (c) 2021 by Rivos Inc. | ||
*/ | ||
#ifndef __ASM_CPU_OPS_SBI_H | ||
#define __ASM_CPU_OPS_SBI_H | ||
|
||
#ifndef __ASSEMBLY__ | ||
#include <linux/init.h> | ||
#include <linux/sched.h> | ||
#include <linux/threads.h> | ||
|
||
/** | ||
* struct sbi_hart_boot_data - Hart specific boot used during booting and | ||
* cpu hotplug. | ||
* @task_ptr: A pointer to the hart specific tp | ||
* @stack_ptr: A pointer to the hart specific sp | ||
*/ | ||
struct sbi_hart_boot_data { | ||
void *task_ptr; | ||
void *stack_ptr; | ||
}; | ||
#endif | ||
|
||
#endif /* ifndef __ASM_CPU_OPS_SBI_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters