-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve RISC-V multi core boot #132
base: master
Are you sure you want to change the base?
Conversation
axel-h
commented
Nov 13, 2021
- add much more comments
- fix SBI HSM register naming quirk
- Ensure DTB is always passed to primary core boot
- check SBI HSM error when bringing up secondary harts
- Stop wrong boot hart via HSM if possible
- unify stack definitions for all cores
- add multicore helper functions
- Drop variable hsm_exists, pass information as parameter
- Print more log messages
ff35350
to
7c43455
Compare
09be73e
to
12c88f1
Compare
e773b34
to
a3ffa7c
Compare
a0204aa
to
8eec928
Compare
d238b57
to
e097abf
Compare
2b1c483
to
29fc94b
Compare
024584f
to
34cb600
Compare
106bde1
to
6285c40
Compare
@axel-h thanks for the changes. I just want to double check if there are any bugs fixed in the PR. |
@@ -176,17 +176,52 @@ int secondary_go = 0; | |||
int next_logical_core_id = 1; /* incremented by assembly code */ | |||
int mutex = 0; | |||
int core_ready[CONFIG_MAX_NUM_NODES] = { 0 }; | |||
|
|||
static void acquire_multicore_lock(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is used inside this file only, maybe smp_lock and smp_unlock are shorter. just a suggestion.
__atomic_store_n(&mutex, 0, __ATOMIC_RELEASE); | ||
} | ||
|
||
static void set_secondary_cores_go(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unleash_secondary_cores?
|
||
_start1: /* a0 must hold current hard ID passed by bootloader */ | ||
/* a1 must hold dtb address passed by bootloader */ | ||
/*----------------------------------------------------------------------------*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this basically has no code logic changes? In this case, maybe we should state it in the commit message clearly.
elfloader-tool/src/arch-riscv/boot.c
Outdated
@@ -220,6 +220,7 @@ static int run_elfloader(UNUSED word_t hart_id, void *bootloader_dtb) | |||
} | |||
|
|||
#if CONFIG_MAX_NUM_NODES > 1 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the additional empty lines?
- Use word_t to adapt to architecture - sbi_hart_start() takes a custom argument. - hart ID and custom argument is passed when starting a secondary hart. Signed-off-by: Axel Heider <axelheider@gmx.de>
This also makes the comment about a1 correct again. Signed-off-by: Axel Heider <axelheider@gmx.de>
- declare stack fully in C code - use one array that holds all stack - use CONFIG_KERNEL_STACK_BITS for size Signed-off-by: Axel Heider <axelheider@gmx.de>
Signed-off-by: Axel Heider <axelheider@gmx.de>
Reorder code blocks and improve comments. Signed-off-by: Axel Heider <axelheider@gmx.de>
Use wrapper function to Improve code readability. Signed-off-by: Axel Heider <axelheider@gmx.de>