Commit b738c6ea authored by Ricardo Neri's avatar Ricardo Neri Committed by Matt Fleming

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

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: default avatarRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Borislav Petkov <bp@suse.de>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent de05764e
...@@ -34,10 +34,23 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); ...@@ -34,10 +34,23 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...);
/* Use this macro if your virtual returns a non-void value */ /* Use this macro if your virtual returns a non-void value */
#define efi_call_virt(f, args...) \ #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 */ /* 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) #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment