-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-125444: Fix illegal instruction for older Arm architectures #125574
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
Conversation
On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only.
This has been tested by @rossburton by manually building CPython and testing it with software emulation. With the 3.13 release:
With this PR:
|
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.
Mostly LGTM, but may I ask should we define a new variable like __arm_7_or_new__
to keep the arch check have same code style? (BTW this is personal thought)
I would prefer to leave it as is to keep it "standard" as the rest of the macros used here. The code style is different but it is the standard way to use these macros. |
Also the aim is to upstream a similar fix to https://github.com/microsoft/mimalloc/ as well, so I would prefer not do to have a "localised" patch for CPython. |
Thanks @diegorusso for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Hmmm... the backporting is going slowly. |
Thanks @diegorusso for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ythonGH-125574) On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only. (cherry picked from commit feda9aa) Co-authored-by: Diego Russo <[email protected]>
GH-125595 is a backport of this pull request to the 3.13 branch. |
…GH-125574) (GH-125595) On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only. (cherry picked from commit feda9aa) Co-authored-by: Diego Russo <[email protected]>
…ython#125574) On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only.
On Arm v5 it is not possible to get the thread ID via c13 register hence the illegal instruction. The c13 register started to provide thread ID since Arm v6K architecture variant. Other variants of Arm v6 (T2, Z and base) don’t provide the thread ID via c13. For the sake of simplicity we group v5 and v6 together and consider that instructions for Arm v7 only.