aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/platform/efi/efi_64.c
diff options
context:
space:
mode:
authorGravatar Andy Lutomirski <luto@kernel.org> 2021-01-20 21:09:50 -0800
committerGravatar Borislav Petkov <bp@suse.de> 2021-01-29 12:22:15 +0100
commitb0dc553cfc9d3bc2c7b8672b0b2fcf0edf0c3b6e (patch)
tree96c4bd6d9fe44564243e63867c4c0c7e7767141e /arch/x86/platform/efi/efi_64.c
parentLinux 5.11-rc5 (diff)
downloadlinux-b0dc553cfc9d3bc2c7b8672b0b2fcf0edf0c3b6e.tar.gz
linux-b0dc553cfc9d3bc2c7b8672b0b2fcf0edf0c3b6e.tar.bz2
linux-b0dc553cfc9d3bc2c7b8672b0b2fcf0edf0c3b6e.zip
x86/fpu: Make the EFI FPU calling convention explicit
EFI uses kernel_fpu_begin() to conform to the UEFI calling convention. This specifically requires initializing FCW (FPU Control Word), whereas no sane 64-bit kernel code should use legacy 387 operations that reference FCW. This should allow to safely change the default semantics of kernel_fpu_begin() to stop initializing FCW on 64-bit kernels. [ bp: Massage commit message a little. ] Signed-off-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/25d392fff64680e0f4bb8cf0b1003314dc29eafe.1611205691.git.luto@kernel.org
Diffstat (limited to 'arch/x86/platform/efi/efi_64.c')
-rw-r--r--arch/x86/platform/efi/efi_64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index e1e8d4e3a213..cf7b3bfe1a1e 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -850,7 +850,7 @@ efi_set_virtual_address_map(unsigned long memory_map_size,
virtual_map);
efi_switch_mm(&efi_mm);
- kernel_fpu_begin();
+ efi_fpu_begin();
/* Disable interrupts around EFI calls: */
local_irq_save(flags);
@@ -859,7 +859,7 @@ efi_set_virtual_address_map(unsigned long memory_map_size,
descriptor_version, virtual_map);
local_irq_restore(flags);
- kernel_fpu_end();
+ efi_fpu_end();
/* grab the virtually remapped EFI runtime services table pointer */
efi.runtime = READ_ONCE(systab->runtime);