Page MenuHomeFreeBSD

STACKALIGN: Reimplement in terms of __align_down
AcceptedPublic

Authored by jhb on Tue, Jan 27, 10:29 PM.
Tags
None
Referenced Files
F143623541: D54920.diff
Sat, Jan 31, 2:30 AM
Unknown Object (File)
Thu, Jan 29, 5:14 AM
Unknown Object (File)
Wed, Jan 28, 10:17 AM
Unknown Object (File)
Wed, Jan 28, 9:01 AM
Unknown Object (File)
Wed, Jan 28, 3:19 AM
Unknown Object (File)
Wed, Jan 28, 2:50 AM

Details

Summary

This changes STACKALIGN to be type-preserving when operating on
pointers.

Diff Detail

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

Event Timeline

jhb requested review of this revision.Tue, Jan 27, 10:29 PM
sys/arm/include/param.h
50

Why STACKALIGN needs to be MD then? It is enough to have STACKALIGNBYTES defined in machine/param.h.
And please add a comment that it is type-preserving.

Effort: CHERI upstreaming or whatever it is seems like it would apply?

brooks added inline comments.
sys/arm/include/param.h
50

It's only defined on arm/riscv.

STACKALIGNBYTES should surely be STACKALIGN_MASK or the like, but that's a different change.

This revision is now accepted and ready to land.Wed, Jan 28, 10:12 AM
sys/arm/include/param.h
50

It's only defined on arm/riscv.

Yes, this is why I said that it is enough to have STACKALIGNBYTES in machine/param.h.
sys/param.h could then do

#ifdef STACKALIGNBYTES
#define STACKALIGN ...
#endif

and it would be immediately have uses at least on amd64 where we align stack after the signal frame.
Might be for i386 too, but I do not remember.

sys/arm/include/param.h
50

I would be happy to move it. I do think it would be nicer on other arches as well. I do wish the STACKALIGNBYTES wasn't the biased value. I'm not sure if we expose this to userland though. :( Let me see if it's feasible to change that to the unbiased value.