Skip to content

Enable SMP with per-hart runtime state on RISC-V#26

Merged
codingskynet merged 5 commits into
mainfrom
feat/smp
Jul 21, 2026
Merged

Enable SMP with per-hart runtime state on RISC-V#26
codingskynet merged 5 commits into
mainfrom
feat/smp

Conversation

@codingskynet

Copy link
Copy Markdown
Owner

Summary

  • Bring up secondary RISC-V harts using a boot-hart release protocol.
  • Add PerCore state for hart IDs, current threads, idle contexts, and dedicated panic stacks.
  • Preserve the kernel tp value across user-mode traps and thread migration.
  • Initialize trap and timer state independently on each hart.
  • Run the scheduler on every hart and expose the current hart ID through a syscall.
  • Add a MicroPython smp.hart_id() module and SMP smoke coverage.
  • Keep a separate emergency panic stack for the early boot phase before PerCore is installed.
  • Remove the obsolete U-mode trap stack overflow smoke test.
  • Update the Rust toolchain and LLVM tools component.

Testing

  • make check
  • make run DEBUG=1 FEATURES=smoke-kernel-stack-overflow
  • Verified the expected kernel stack overflow panic under 4-hart QEMU.

Assited-by: openai/gpt-5.6-sol
@codingskynet

codingskynet commented Jul 21, 2026

Copy link
Copy Markdown
Owner Author

TODO: 나중에는 idle thread를 per-core 단위로만 관리할 것. 지금은 임의의 cpu core가 계속 임의의 thread를 실행할 수 있도록, 항상 idle thread를 코어 개수만큼 생성한 것과 같음 어차피 지금 안 고치면 안 돌아가서 고침

@codingskynet
codingskynet merged commit b30800d into main Jul 21, 2026
2 checks passed
@codingskynet
codingskynet deleted the feat/smp branch July 21, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant