VORTEXM4: s2_usable() runs RDSVL before the SME2 check (SIGILL without SME)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- c
- Domain
- backend, performance
Research direction
Start by reading kernel/arm64/sme2_gemm_detect.h and inspect how s2_usable() evaluates the SME2 check and svcntsw(). The issue points to disassembly of sme_sgemm_kernel.o as evidence of the SIGILL; compare that behavior with the fix described in linked pull request #6153. Done means s2_usable() does not execute RDSVL when SME2 is absent.
Written by the indexing model from the issue text.
Description
s2_usable() in kernel/arm64/sme2_gemm_detect.h computes ok = sme2 && svcntsw() == 16;. Clang treats svcntsw() (RDSVL) as free of side effects and if-converts the expression, so RDSVL runs before the FEAT_SME2 result is tested. Disassembly of sme_sgemm_kernel.o (Apple clang 21):
bl _sysctlbyname
ldr w8, [sp, #0x8fc] ; FEAT_SME2 value
rdsvl x9, #0x1 ; runs whether or not SME is present
lsr x9, x9, #2
cmp x9, #0x10
cset w9, eq
cmp w8, #0x0
csel w8, wzr, w9, eq
On a CPU without SME this is SIGILL. A VORTEXM4 build is not meant to run on M1-M3, but before #6074 its level-3 routines still worked there on NEON kernels; now they reach the SME2 kernels' s2_usable() and crash. #6142 contains a fix (the vector length read in a separate noinline inline-asm function, called only when SME2 is present). That fix could also go in on its own, ahead of #6142.
- Dominant language
- C
- Stars
- 7.7k
- Forks
- 1.7k
- Avg merge
- 1d 1m
- Merged PRs (30d)
- 61
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenMathLib/OpenBLAS
-
cblas_[cz]gemm_batch_strided: strides not scaled by COMPSIZE, wrong results for batch count >= 2Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenMathLib/OpenBLAS#6214 ·
Maintainers usually reply within 1 day
-
Case-sensitive core-name check in #6027 disables AMD AVX-512 block-size overridePossibly taken @martin-frbg claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenMathLib/OpenBLAS#6192 ·
Maintainers usually reply within 1 day
-
New releaseOpen
Difficulty 4/5 3-5 days Newbie friendliness 12/100
OpenMathLib/OpenBLAS#6189 · 10 comments ·
Maintainers usually reply within 1 day
-
Bug in other software
Difficulty 4/5 3-5 days Newbie friendliness 18/100
OpenMathLib/OpenBLAS#6173 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
OpenMathLib/OpenBLAS#6152 ·
Maintainers usually reply within 1 day
All issues in OpenMathLib/OpenBLAS
Similar issues
-
ai-driven-fuzzing bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
linagora/open-bastion#425 ·
Maintainers usually reply within 1 day
-
question
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
examples/dnsdoctor: cleanup.sh stops at the first missing piece of a setup.sh that did not finishOpenseverity: low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
luainkernel/lunatik#2263 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 72/100
vercel-labs/scriptc#2910 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
darktable-org/darktable#22939 ·
Maintainers usually reply within 1 day