Skip to content

Commit

Permalink
x86/efi: Save and restore FPU context around efi_calls (x86_64)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ricardo Neri authored and Matt Fleming committed Apr 17, 2014
1 parent 982e239 commit de05764
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _ASM_X86_EFI_H
#define _ASM_X86_EFI_H

#include <asm/i387.h>
/*
* We map the EFI regions needed for runtime services non-contiguously,
* with preserved alignment on virtual addresses starting from -4G down
Expand Down Expand Up @@ -54,7 +55,9 @@ extern u64 asmlinkage efi_call(void *fp, ...);
\
efi_sync_low_kernel_mappings(); \
preempt_disable(); \
__kernel_fpu_begin(); \
__s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \
__kernel_fpu_end(); \
preempt_enable(); \
__s; \
})
Expand Down

0 comments on commit de05764

Please sign in to comment.