Skip to content

Conversation

@midnightveil
Copy link
Contributor

@midnightveil midnightveil commented Nov 11, 2025

This PR adds support for SMP builds of the kernel on AArch64.

We have a psci_target_cpus[] array, currently hardcoded, for the IDs of the cores to boot. This should match the values specified in the device tree /cpu@0/ node's <reg> field. Note that due to quirks of various platforms (e.g. OdroidC4), these do not (but can) match the MPIDR values that hardware reports, so we maintain a different table of their MPIDR values.

There a few TODOs scattered throughout this code.

@midnightveil
Copy link
Contributor Author

Ping @Indanz as you had comments on the previous iteration of this code in the smp branch. This has followed your pieces of advice.

_start:

mrs x0, mpidr_el1
and x0, x0,#0xFF // Check processor id
Copy link
Contributor Author

@midnightveil midnightveil Nov 11, 2025

Choose a reason for hiding this comment

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

I'll add a quick note on why this was removed: this is wrong, as we are not guaranteed that the CPU we are booting on will have the Aff0 value of the MPIDR_EL1 to be 0. Nor do we expect that this part of the code should run on multiple cores. This dates back the initial public release of seL4CP.

@midnightveil midnightveil force-pushed the julia/smp branch 2 times, most recently from 9d7020c to 9e6c71b Compare November 11, 2025 07:17
@Ivan-Velickovic Ivan-Velickovic changed the title Add SMP support for AArch64 Add SMP support for ARM/RISC-V Nov 21, 2025
Comment on lines 106 to 103
j spin_hart /* Spin any hart that isn't FIRST_HART_ID since we only support single-core right now. */
li a7, SBI_HSM_BASE_EID
li a6, 0x1
ecall
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to clean this up and explain what's going on.

@Ivan-Velickovic
Copy link
Collaborator

Ivan-Velickovic commented Nov 21, 2025

Once we finish the code changes we'll need to update a couple sections on the manual (e.g the list/description of Microkit configs and the QEMU sections on how to boot with multiple cores).

We'll also need to adjust the porting platform support section for the SMP related changes.

midnightveil and others added 15 commits November 24, 2025 14:14
Signed-off-by: Julia Vassiliki <[email protected]>
this fixes real hardware

Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Ivan Velickovic <[email protected]>
Signed-off-by: Ivan Velickovic <[email protected]>
Signed-off-by: Ivan Velickovic <[email protected]>
Signed-off-by: Ivan Velickovic <[email protected]>
Signed-off-by: Ivan Velickovic <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
This means that the board names are the same, but we
build extra configurations of the boards with different
kernel configurations for SMP support. This is cleaner, as
we were finding that renaming the boards was broken a lot
of our build systems code which needed to be duplicate for
new boards.

I'm not entirely convinced this is the best possible solution,
but it is the nicest we can think of.

Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
(instead of horribly violating it)

Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
Signed-off-by: Julia Vassiliki <[email protected]>
To make it clearer what its purpose is.

Signed-off-by: Julia Vassiliki <[email protected]>
@midnightveil
Copy link
Contributor Author

This is blocked on seL4/seL4#1563

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.

3 participants