]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64/fpsimd: Don't warn when EFI execution context is preemptible
authorArd Biesheuvel <ardb@kernel.org>
Wed, 15 Oct 2025 20:56:38 +0000 (22:56 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 11 Nov 2025 18:59:22 +0000 (18:59 +0000)
Kernel mode FP/SIMD no longer requires preemption to be disabled, so
only warn on uses of FP/SIMD from preemptible context if the fallback
path is taken for cases where kernel mode NEON would not be allowed
otherwise.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/fpsimd.c

index e3f8f51748bc948cd6366517398011d17fbad84d..3d848c89604eee01a51686fc16a44c6c13cd9b9d 100644 (file)
@@ -1934,11 +1934,11 @@ void __efi_fpsimd_begin(void)
        if (!system_supports_fpsimd())
                return;
 
-       WARN_ON(preemptible());
-
        if (may_use_simd()) {
                kernel_neon_begin();
        } else {
+               WARN_ON(preemptible());
+
                /*
                 * If !efi_sve_state, SVE can't be in use yet and doesn't need
                 * preserving: