riscv-software-src / riscv-software-src/opensbi
Firmware SMP boot bug
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 712
- PR merge metrics
- No merged PRs in 30d
Description
The cold-boot-hart lottery in fw_base.S has recently been modified by using the _boot_status variable instead of the _relocate_lottery variable. This introduces a data race since the _boot_status variable is also written by the cold-boot hart to indicate the current boot stage without waiting for the other cores to have completed the lottery. If a non-boot hart enters the lottery when the boot-hart has already completed relocation _boot_status is overwritten and the non-boot hart is stuck forever in _wait_for_boot_hart.
The change has been introduced in this commit.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with fw_base.S and compare the cold-boot-hart lottery changes in commit 8151105af5e4bd5d2a17fe0babd6cff3b36496fb. Trace how _boot_status and _relocate_lottery are read and written by boot and non-boot harts. Done means a non-boot hart cannot be left waiting forever after relocation while boot-stage status remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100