• Dave Martin's avatar
    arm64: neon: Allow EFI runtime services to use FPSIMD in irq context · 4328825d
    Dave Martin authored
    In order to be able to cope with kernel-mode NEON being unavailable
    in hardirq/nmi context and non-nestable, we need special handling
    for EFI runtime service calls that may be made during an interrupt
    that interrupted a kernel_neon_begin()..._end() block.  This will
    occur if the kernel tries to write diagnostic data to EFI
    persistent storage during a panic triggered by an NMI for example.
    
    EFI runtime services specify an ABI that clobbers the FPSIMD state,
    rather than being able to use it optionally as an accelerator.
    This means that EFI is really a special case and can be handled
    specially.
    
    To enable EFI calls from interrupts, this patch creates dedicated
    __efi_fpsimd_{begin,end}() helpers solely for this purpose, which
    save/restore to a separate percpu buffer if called in a context
    where kernel_neon_begin() is not usable.
    Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
    Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    4328825d
fpsimd.h 2.36 KB