Skip to content

smp: Allow switching the boot (primary) CPU core#563

Open
jannau wants to merge 3 commits into
AsahiLinux:mainfrom
jannau:switch_boot_cpu
Open

smp: Allow switching the boot (primary) CPU core#563
jannau wants to merge 3 commits into
AsahiLinux:mainfrom
jannau:switch_boot_cpu

Conversation

@jannau

@jannau jannau commented Apr 16, 2026

Copy link
Copy Markdown
Member
M3 and later Apple silicon SoCs start m1n1 on the first perfomance core.
The cluster layout remained unchanged with an efficiency core cluster
first. This causes an annoying but mostly cosmetic issue in Linux. Linux
assigns CPU index 0 to the boot CPU. This results in a mismatch of
logical and physical CPU core order. As seen with the Radxa Orion O6
this will at least generate support questions but is also annoying for
CPU pinning. It's likely to result in pinning to mixture of performance
and efficiency cores.
While functionality it should not matter to which secondary CPU core
control is passed the only expected use case is switching to CPU core 0.

@jannau jannau requested a review from svenpeter42 as a code owner April 16, 2026 17:34
It will be used to switch to CPU 0 on M3 and later to avoid confusion
when Linux is not started with CPU 0.

Signed-off-by: Janne Grunau <j@jannau.net>
Comment thread src/proxy.c Outdated
jannau added 2 commits April 17, 2026 22:15
M3 and later Apple silicon SoCs start m1n1 on the first perfomance core.
The cluster layout remained unchanged with an efficiency core cluster
first. This causes an annoying but mostly cosmetic issue in Linux. Linux
assigns CPU index 0 to the boot CPU. This results in a mismatch of
logical and physical CPU core order. As seen with the Radxa Orion O6
this will at least generate support questions but is also annoying for
CPU pinning. It's likely to result in pinning to mixture of performance
and efficiency cores.
While functionality it should not matter to which secondary CPU core
control is passed the only expected use case is switching to CPU core 0.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
@jannau

jannau commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

I've seen now some unhandled exceptions after switching the boot CPU during DT preparation so it's possible that there is something missing during initialisation of the new boot CPU

@yuyuyureka

Copy link
Copy Markdown
Contributor

Could we already merge the bits in src/smp.c without using it in tools/linux.py until we have figured the unhandled exceptions?

@jannau

jannau commented May 6, 2026

Copy link
Copy Markdown
Member Author

first it needs to be rebased. I don't see this as urgent as it fixes a mostly cosmetic issue.

@yuyuyureka

Copy link
Copy Markdown
Contributor

I have rebased it here: https://github.com/yuyuyureka/m1n1/commits/switch_boot_cpu/

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.

2 participants