-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arch/arm64 Fix the SP unalignment issues #15748
Conversation
zynq-mpsoc and zcu111 borad was broken by apache#15437, because apache#15437 changes ARM64_CONTEXT_REGS from 36 to 37, resulting in the stack no longer being 16-byte aligned which appears to violate the ARMv8-A architecture's requirement for 16-byte stack alignment. this commit changes ARM64_CONTEXT_REGS to 38 to fix this issues.
@zouboan nice work investigating this issue and submitting this fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @zouboan :-) Good catch! :-)
Can you also perform apps/testing/ostest
and other possible tests to make sure this REG_RESERVED
is never used? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for the reminder. After checking, I found that |
Thank you for understanding @zouboan, and for fixing the problem!! :-) We are discussing on the mailing list how to improve testing of hardware related changes, to avoid this kind of breaks in future, that better testing is required, and we should not rush merging because that rush already impacts users and self-compatibility. Take your time. Lets try out one step deeper verification (i.e. ostest maybe some benchmarks). If you have ideas on what should be part of standard mandatory "selftest" for architecture related changes please share :-) |
I tested 'ostest' 'ping' and 'uname -a', and both tests passed. ostest:
uname:
ping:
|
Thank you @zouboan and @anchao !! After long discussions on the mailing lists the conclusion is to take time and extra caution with critical kernel / architecture changes, as they impact lots of users, we need solid real world hardware runtime evidence triple checked that things are working as expected, which is already done above, thank you so much!! :-) |
Summary
zynq-mpsoc and zcu111 borad was broken by #15437, because #15437 changes ARM64_CONTEXT_REGS from 36 to 37, resulting in the stack no longer being 16-byte aligned which appears to violate the ARMv8-A architecture's requirement for 16-byte stack alignment. this PR changes ARM64_CONTEXT_REGS to 38 to fix the issues #15747.
Impact
Impact on user: YES, this PR changes ARM64_CONTEXT_REGS from 37 to 38 will consume 8 byte more memary, but the mpact is acceptable.
Impact on build: NO, this PR just changes the value of ARM64_CONTEXT_REGS.
Impact on hardware: YES. This impacts all the arm64 hardware, but tested and passed on ZCU111 board.
Impact on documentation: NO, there's no functionality or usage changes, so the documentation does not need to bo modified.
Impact on security: YES, this PR improved security.
Impact on compatibility:YES, this PR fixed uncompatibility of zynq-mpsoc and zcu111 borad.
Testing
Build Host(s): Linux Ubuntu 22.04, x86_64, Linaro GCC 7.3-2018.04-rc3.
Target(s): Zynq UltraScale+ MPSoC ZCU111 board.
Testing logs:
nsh:
1 tools/configure.sh zcu111:nsh
2 make
3 flash to the QSPI flash of ZCU111 and boot:
JTAG:
1 tools/configure.sh zcu111:jtag
2 make
3 download to the ZCU111 by JTAG and run: