Skip to content

improve RISC-V multi core boot#132

Draft
axel-h wants to merge 12 commits intoseL4:masterfrom
axel-h:patch-axel-7
Draft

improve RISC-V multi core boot#132
axel-h wants to merge 12 commits intoseL4:masterfrom
axel-h:patch-axel-7

Conversation

@axel-h
Copy link
Member

@axel-h 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

@axel-h axel-h added the cleanup label Nov 13, 2021
@axel-h axel-h requested a review from yyshen November 13, 2021 06:46
@axel-h axel-h force-pushed the patch-axel-7 branch 5 times, most recently from ff35350 to 7c43455 Compare November 16, 2021 04:23
@axel-h axel-h force-pushed the patch-axel-7 branch 5 times, most recently from 09be73e to 12c88f1 Compare February 6, 2022 21:49
@axel-h axel-h marked this pull request as draft February 6, 2022 21:59
@axel-h axel-h force-pushed the patch-axel-7 branch 7 times, most recently from e773b34 to a3ffa7c Compare February 7, 2022 01:53
@axel-h axel-h force-pushed the patch-axel-7 branch 3 times, most recently from a0204aa to 8eec928 Compare February 18, 2022 05:01
@axel-h axel-h force-pushed the patch-axel-7 branch 3 times, most recently from d238b57 to e097abf Compare March 1, 2022 17:26
@yyshen
Copy link
Contributor

yyshen commented Dec 2, 2023

@axel-h thanks for the changes. I just want to double check if there are any bugs fixed in the PR.

int mutex = 0;
int core_ready[CONFIG_MAX_NUM_NODES] = { 0 };

static void acquire_multicore_lock(void)
Copy link
Contributor

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)
Copy link
Contributor

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 */
/*----------------------------------------------------------------------------*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor

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.

}

#if CONFIG_MAX_NUM_NODES > 1

Copy link
Contributor

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?

@axel-h axel-h added the hw-build enable all sel4test hardware builds label Jan 15, 2024
@axel-h axel-h force-pushed the patch-axel-7 branch 5 times, most recently from 1533fd2 to ac4d384 Compare July 15, 2025 15:51
axel-h added 5 commits July 15, 2025 19:31
This also makes the comment about a1 correct again.

Signed-off-by: Axel Heider <[email protected]>
hart ID and custom argument is passed when starting a secondary hart.

Signed-off-by: Axel Heider <[email protected]>
@axel-h axel-h added the hw-test enable sel4test hardware builds + runs label Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup hw-build enable all sel4test hardware builds hw-test enable sel4test hardware builds + runs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants