-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
arch: riscv: smp: refactor IPI functions and guard with CONFIG_RISCV_SMP_IPI_CLINT
#78493
Conversation
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.
Rather than adding another abstraction layer, I'd suggest creating ipi_clint.c
and ipi_plic.c then implement arch_sched_directed_ipi()
and friends for each
of them. The cpu_pending_ipi[]
array exists only because there is no way to
distinguish different IPI causes using CLINT. It might be the case that the
PLIC version doesn't need it.
cd58558
to
bfc7977
Compare
True, but I think it depends on the way the In any case, there's quite a bit of work to be done before we can get to
As an alternative to #65824 (compile out the entirety of clint IPI code), this PR is more like an incremental step for us to implement the |
CONFIG_RISCV_SMP_IPI_CLINT
Currently, the RISC-V SMP IPI implementation is CLINT-based. However, IPI in RISC-V is not necessarily always done through a CLINT, in SoC with PLIC connected to the MSIP (i.e. Andes AE350), IPI has to be routed through the PLIC. This patch refactor the IPI delivery into functions and guard it with `CONFIG_RISCV_SMP_IPI_CLINT`, so that for SoC that do not have a clint device, and requires a different IPI mechanism, they can implement their own `z_riscv_ipi_send()` & `z_riscv_ipi_clear()`. Signed-off-by: Yong Cong Sin <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]>
bfc7977
to
374aac5
Compare
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Currently, the RISC-V SMP IPI implementation is CLINT-based. However, IPI in RISC-V is not necessarily always done through a CLINT, in SoC with PLIC connected to the MSIP (i.e. Andes AE350's PLIC_SW), IPI has to be routed through the PLIC.
This patch refactor the IPI delivery into functions and guard it with
CONFIG_RISCV_SMP_IPI_CLINT
, so that for SoC that do not have asifive,clint0
device, and has a different IPI mechanism, they can implement their ownz_riscv_ipi_send()
&z_riscv_ipi_clear()
.Note
This is an alternative for #65824