Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/efi: Save and restore FPU context around efi_calls (x86_64)

Do a complete FPU context save/restore around the EFI calls. This required
as runtime EFI firmware may potentially use the FPU.

This change covers only the x86_64 configuration.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Borislav Petkov <bp@suse.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>

authored by

Ricardo Neri and committed by
Matt Fleming
de05764e 982e239c

+3
+3
arch/x86/include/asm/efi.h
··· 1 1 #ifndef _ASM_X86_EFI_H 2 2 #define _ASM_X86_EFI_H 3 3 4 + #include <asm/i387.h> 4 5 /* 5 6 * We map the EFI regions needed for runtime services non-contiguously, 6 7 * with preserved alignment on virtual addresses starting from -4G down ··· 55 54 \ 56 55 efi_sync_low_kernel_mappings(); \ 57 56 preempt_disable(); \ 57 + __kernel_fpu_begin(); \ 58 58 __s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \ 59 + __kernel_fpu_end(); \ 59 60 preempt_enable(); \ 60 61 __s; \ 61 62 })