Skip to content

T8132 smp#536

Draft
yuyuyureka wants to merge 3 commits intoAsahiLinux:mainfrom
yuyuyureka:t8132-smp
Draft

T8132 smp#536
yuyuyureka wants to merge 3 commits intoAsahiLinux:mainfrom
yuyuyureka:t8132-smp

Conversation

@yuyuyureka
Copy link
Contributor

@yuyuyureka yuyuyureka commented Jan 21, 2026

According to the discussion here, the RVBAR at cpu_impl_reg+0x00 is already set to the m1n1 entrypoint and locked by iBoot for all cores on M4.

Indeed, I can see the following values:

m1n1 base: 0x100034f4000
E-Cores cpu_impl_reg at 0x210X50000: 0x100100034f4001
P-Cores cpu_impl_reg at 0x211X50000: 0x1100100034f4001

And voila, when skipping the writes when the value is already correct (which previously produced SErrors when writing to the P-Core cpu_impl_reg), smp_start_secondaries() now works as expected.

@yuyuyureka yuyuyureka force-pushed the t8132-smp branch 2 times, most recently from a7d0ac2 to 40e2963 Compare January 24, 2026 08:56
continue
if val & 1:
print(f"{hex(val & 0xfffffffff000)} != {hex(rvbar)}")
print("The cpu_impl_reg is already locked, this might fail...")
Copy link
Member

Choose a reason for hiding this comment

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

I'd just throw an exception here or even check for this earlier and refuse to even start.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


write64(impl, (u64)_vectors_start);
if ((read64(impl) & 0xfffffffff000) != (u64)_vectors_start) {
write64(impl, (u64)_vectors_start);
Copy link
Member

Choose a reason for hiding this comment

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

Same here, if the register is locked and doesn't contain the right address just fail earlier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Yureka <yureka@cyberchaos.dev>
if locked and do_write:
raise Exception("RVBAR is locked and does not already contain start address")

if write_rvbar:
Copy link
Member

Choose a reason for hiding this comment

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

How can this even work? write_rvbar isn't defined anywhere before. Please fix and test this before pushing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now compile-tested. I'll be a while before I can test on my M4 again.

Signed-off-by: Yureka <yureka@cyberchaos.dev>
Signed-off-by: Yureka <yureka@cyberchaos.dev>
@yuyuyureka yuyuyureka marked this pull request as draft February 8, 2026 19:17
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