]> git.ipfire.org Git - thirdparty/linux.git/commit
arm64/efi: Remove unneeded SVE/SME fallback preserve/store handling
authorArd Biesheuvel <ardb@kernel.org>
Sat, 6 Dec 2025 19:01:17 +0000 (20:01 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 15 Dec 2025 12:05:37 +0000 (12:05 +0000)
commit63de2b3859ba1def9f43ed0a9c25a68810208e5c
treec8b67223ab137bd5d4ef91dc9a67f5007acab6ed
parenteb972eab0794dedeef5b3b1845e5f9a78793f184
arm64/efi: Remove unneeded SVE/SME fallback preserve/store handling

Since commit 7137a203b251 ("arm64/fpsimd: Permit kernel mode NEON with
IRQs off"), the only condition under which the fallback path is taken
for FP/SIMD preserve/restore across a EFI runtime call is when it is
called from hardirq or NMI context.

In practice, this only happens when the EFI pstore driver is called to
dump the kernel log buffer into a EFI variable under a panic, oops or
emergency_restart() condition, and none of these can be expected to
result in a return to user space for the task in question.

This means that the existing EFI-specific logic for preserving and
restoring SVE/SME state is pointless, and can be removed.

Instead, kill the task, so that an exceedingly unlikely inadvertent
return to user space does not proceed with a corrupted FP/SIMD state.
Also, retain the preserve and restore of the base FP/SIMD state, as that
might belong to kernel mode use of FP/SIMD. (Note that EFI runtime calls
are never invoked reentrantly, even in this case, and so any interrupted
kernel mode FP/SIMD usage will be unrelated to EFI)

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