Merge tag 'x86_fpu_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 21 Feb 2021 04:07:44 +0000 (20:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 21 Feb 2021 04:07:44 +0000 (20:07 -0800)
Pull x86 FPU updates from Borislav Petkov:
 "x86 fpu usage optimization and cleanups:

   - make 64-bit kernel code which uses 387 insns request a x87 init
     (FNINIT) explicitly when using the FPU

   - misc cleanups"

* tag 'x86_fpu_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/fpu/xstate: Use sizeof() instead of a constant
  x86/fpu/64: Don't FNINIT in kernel_fpu_begin()
  x86/fpu: Make the EFI FPU calling convention explicit

1  2 
arch/x86/include/asm/efi.h
arch/x86/platform/efi/efi_64.c

@@@ -98,9 -113,19 +114,9 @@@ extern asmlinkage u64 __efi_call(void *
  #define arch_efi_call_virt_setup()                                    \
  ({                                                                    \
        efi_sync_low_kernel_mappings();                                 \
-       kernel_fpu_begin();                                             \
+       efi_fpu_begin();                                                \
        firmware_restrict_branch_speculation_start();                   \
 -      efi_switch_mm(&efi_mm);                                         \
 +      efi_enter_mm();                                                 \
  })
  
  #define arch_efi_call_virt(p, f, args...)                             \
  
  #define arch_efi_call_virt_teardown()                                 \
  ({                                                                    \
 -      efi_switch_mm(efi_scratch.prev_mm);                             \
 +      efi_leave_mm();                                                 \
        firmware_restrict_branch_speculation_end();                     \
-       kernel_fpu_end();                                               \
+       efi_fpu_end();                                                  \
  })
  
  #ifdef CONFIG_KASAN
@@@ -832,9 -848,9 +832,9 @@@ efi_set_virtual_address_map(unsigned lo
                                                         descriptor_size,
                                                         descriptor_version,
                                                         virtual_map);
 -      efi_switch_mm(&efi_mm);
 +      efi_enter_mm();
  
-       kernel_fpu_begin();
+       efi_fpu_begin();
  
        /* Disable interrupts around EFI calls: */
        local_irq_save(flags);