diff options
author | Ricardo Neri <ricardo.neri-calderon@linux.intel.com> | 2014-03-27 18:10:43 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-04-17 08:26:33 -0400 |
commit | b738c6ea49b4e98e6ca0651da82a610f996a16ae (patch) | |
tree | 54376d57ee0c3befdde3302df4d9a1c13af88439 /arch | |
parent | de05764e0b2a3d9559e099a2e134f8cef4500fdd (diff) |
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: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Cc: Borislav Petkov <bp@suse.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/efi.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 0b19187cc882..1eb5f6433ad8 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -34,10 +34,23 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
34 | 34 | ||
35 | /* Use this macro if your virtual returns a non-void value */ | 35 | /* Use this macro if your virtual returns a non-void value */ |
36 | #define efi_call_virt(f, args...) \ | 36 | #define efi_call_virt(f, args...) \ |
37 | ((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args) | 37 | ({ \ |
38 | efi_status_t __s; \ | ||
39 | kernel_fpu_begin(); \ | ||
40 | __s = ((efi_##f##_t __attribute__((regparm(0)))*) \ | ||
41 | efi.systab->runtime->f)(args); \ | ||
42 | kernel_fpu_end(); \ | ||
43 | __s; \ | ||
44 | }) | ||
38 | 45 | ||
39 | /* Use this macro if your virtual call does not return any value */ | 46 | /* Use this macro if your virtual call does not return any value */ |
40 | #define __efi_call_virt(f, args...) efi_call_virt(f, args) | 47 | #define __efi_call_virt(f, args...) \ |
48 | ({ \ | ||
49 | kernel_fpu_begin(); \ | ||
50 | ((efi_##f##_t __attribute__((regparm(0)))*) \ | ||
51 | efi.systab->runtime->f)(args); \ | ||
52 | kernel_fpu_end(); \ | ||
53 | }) | ||
41 | 54 | ||
42 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) | 55 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) |
43 | 56 | ||