Page MenuHomeFreeBSD

powerpc: Fix alignment of initial PCB on kstack
ClosedPublic

Authored by jhb on Fri, Jan 23, 6:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 31, 2:33 PM
Unknown Object (File)
Tue, Jan 27, 8:08 PM
Unknown Object (File)
Sat, Jan 24, 9:37 PM
Unknown Object (File)
Sat, Jan 24, 9:02 PM
Unknown Object (File)
Sat, Jan 24, 10:38 AM
Unknown Object (File)
Sat, Jan 24, 3:27 AM
Unknown Object (File)
Sat, Jan 24, 3:27 AM
Unknown Object (File)
Sat, Jan 24, 3:23 AM
Subscribers

Details

Summary

Commit cc81c44dd806737f98b4fd4094674dd71c8749f3 aimed to consolidate
duplicated code between the Book-E and AIM backends. For
cpu_thread_alloc cpu_thread_alloc and cpu_fork it used the AIM
functions which used a bogus alignment mask (~0x2f). The Book-E
functions used a proper alignment mask (~0x3f). The AIM functions
appear to have been busted since they were first imported in commit
919cb3362fded33aca682a6ac57777f8fff86e36.

To fix, use the Book-E mask which requests 64 byte alignment.
Probably this was harmless in practice since td_kstack is page aligned
and struct pcb is probably a multiple of 32 bytes in size, so the 0x10
bit should have been clear anyway.

Fixes: cc81c44dd806 ("Unify ABI-related bits of the Book-E and AIM...")
Effort: CHERI upstreaming
Sponsored by: AFRL, DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70077
Build 66960: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Fri, Jan 23, 6:45 PM

If that's used any more often than these two locations, we may want to add a STACK_ALIGNMENT macro.

This revision is now accepted and ready to land.Fri, Jan 23, 7:09 PM

These are the only two I found. Some other architectures have a STACKALIGN macro

This revision was automatically updated to reflect the committed changes.