Enabling and Verifying ARM64 SVE Support in Linux
A practical guide to enabling ARM64 Scalable Vector Extension (SVE) in Linux: verify CPU support, configure the kernel, compile with -march=armv8.1-a+sve, and check binaries at runtime.
20 Nov 2025, 01:18 UTC

The Problem: Illegal Instruction Faults on SVE Binaries
An ARM64 binary built with Scalable Vector Extension (SVE) instructions stops immediately with SIGILL—the illegal instruction signal—when the running kernel has not enabled SVE context switching. The useful takeaway is that SVE support is a stack: the CPU must advertise the feature, the kernel must preserve SVE registers across task switches, and the compiler must emit the correct instructions. This guide covers verifying each layer, enabling the kernel option, compiling a test binary, and checking the result.
Desired Outcome and Prerequisites
Desired outcome: user-space SVE programs execute without illegal instruction faults, and the kernel reports SVE capability. Vector length is discovered at runtime rather than hardcoded, because SVE widths are implementation-defined.
Prerequisites:
- A physical ARM64 CPU with SVE support (for example, Cortex-A78AE, Cortex-A57-SVE, or newer cores).
- Linux kernel 5.10 or later with
CONFIG_SVEenabled. Exact menuconfig paths can vary by version; verify against your kernel source. - A GCC or Clang toolchain that accepts
-march=armv8.1-a+sveand provides thearm_sve.hheader. - Boot firmware that initializes SVE state. Without firmware support, the OS cannot enable the feature even if the CPU has it.
Verifying Hardware and Kernel SVE Support
Run the following on the target ARM64 system:
cat /proc/cpuinfo | grep -i sve
Expected check: the output includes sve in the Features line. If the flag is absent, either the CPU lacks SVE or the kernel has not detected it.
Also inspect boot messages:
dmesg | grep -i sve
Permissions and risk: /proc/cpuinfo is world-readable. dmesg may require root privileges depending on the kernel.dmesg_restrict sysctl setting.
Enabling CONFIG_SVE and Rebuilding the Kernel
On the kernel build host, open the configuration menu:
make menuconfig
Navigate to Processor type and features and select Scalable Vector Extension (CONFIG_SVE). Set it to y to build support into the kernel. This option enables the kernel to save and restore SVE registers during context switches, which is required for user-space SVE execution.
Risk: this changes the kernel image. Rebuild and install:
make -j$(nproc)
make modules_install
make install
Replace $(nproc) with the number of parallel jobs appropriate for your build host. Installing a new kernel alters the boot state.
Compiling and Inspecting an SVE Binary
Create a C source file that uses standard SVE intrinsics. Query the vector length at runtime rather than assuming a fixed width. A minimal illustrative example:
#include <arm_sve.h>
#include <stdio.h>
int main(void) {
uint64_t bytes = svcntb();
printf("SVE vector length: %llu bytes\n", (unsigned long long)bytes);
return 0;
}
Compile with SVE enabled:
gcc -march=armv8.1-a+sve -o test_sve test_sve.c
Or with Clang:
clang -march=armv8.1-a+sve -o test_sve test_sve.c
Risk: running this binary on a non-SVE CPU or a kernel without CONFIG_SVE will raise SIGILL.
Confirm the binary actually contains SVE instructions:
objdump -d test_sve | grep -i sv
Expected check: SVE mnemonics operating on vector registers (z0–z31) appear in the disassembly. If none appear, the compiler did not emit SVE code. As an alternative, clang -march=armv8.1-a+sve -S test_sve.c produces an assembly file you can inspect directly.
Runtime Checks and Recovery
Execute the test program:
./test_sve
Expected check: the program completes without SIGILL and reports the vector length. Because SVE vector length varies by CPU implementation, a program that hardcodes a width may fail on a different ARM64 system.
Recovery options
- Boot failure: use the bootloader menu (GRUB, U-Boot, or vendor equivalent) to select the previous kernel. Keep the old kernel image and initramfs available until the new kernel is confirmed stable.
- Runtime faults: if user-space SVE binaries fault, verify the running kernel was built with
CONFIG_SVE. If not, disable the option, rebuild, and reinstall the previous known-good kernel. - Toolchain mismatch: if the compiler rejects
-march=armv8.1-a+sve, update GCC or Clang to a version with SVE support.
Limitations
CONFIG_SVE enables kernel context-switch support for user-space SVE. Kernel modules that attempt to use SVE registers must manage FPSIMD/SVE state explicitly; this is not automatic and is a specialized use case beyond basic enablement.
SVE requires firmware initialization. A CPU with SVE but incompatible firmware will not expose the feature to Linux. Additionally, binaries compiled with -march=armv8.1-a+sve are not portable to non-SVE ARM64 systems.
Because kernel versions and distribution defaults vary, confirm the exact menuconfig path and option name in your kernel source tree before rebuilding.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.