Skip to content

Commit

Permalink
x86/efi: Save and restore FPU context around efi_calls (i386)
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 i386 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 de05764 commit b738c6e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions arch/x86/include/asm/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,23 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);

/* Use this macro if your virtual returns a non-void value */
#define efi_call_virt(f, args...) \
((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args)
({ \
efi_status_t __s; \
kernel_fpu_begin(); \
__s = ((efi_##f##_t __attribute__((regparm(0)))*) \
efi.systab->runtime->f)(args); \
kernel_fpu_end(); \
__s; \
})

/* Use this macro if your virtual call does not return any value */
#define __efi_call_virt(f, args...) efi_call_virt(f, args)
#define __efi_call_virt(f, args...) \
({ \
kernel_fpu_begin(); \
((efi_##f##_t __attribute__((regparm(0)))*) \
efi.systab->runtime->f)(args); \
kernel_fpu_end(); \
})

#define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size)

Expand Down

0 comments on commit b738c6e

Please sign in to comment.