Skip to contentSkip to conversation

arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels

PATCH New Dave Martin 3 participants 4 messages Aug 31, 2017 – Sep 7, 2017 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels

__efi_fpsimd_begin()/__efi_fpsimd_end() are for use when making EFI calls only, so using them in non-EFI kernels is not allowed.

This patch compiles them out if CONFIG_EFI is not set.

---
 arch/arm64/kernel/fpsimd.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/kernel/fpsimd.c +4 -0
index 3a68cf3..f444f37 100644
@@ -321,6 +321,8 @@ void kernel_neon_end(void)
 }
 EXPORT_SYMBOL(kernel_neon_end);
 
+#ifdef CONFIG_EFI
+
 static DEFINE_PER_CPU(struct fpsimd_state, efi_fpsimd_state);
 static DEFINE_PER_CPU(bool, efi_fpsimd_state_used);
 
@@ -370,6 +372,8 @@ void __efi_fpsimd_end(void)
 		kernel_neon_end();
 }
 
+#endif /* CONFIG_EFI */
+
 #endif /* CONFIG_KERNEL_MODE_NEON */
 
 #ifdef CONFIG_CPU_PM
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels

Quoted 6 lines · Dave Martin

__efi_fpsimd_begin()/__efi_fpsimd_end() are for use when making EFI calls only, so using them in non-EFI kernels is not allowed.

This patch compiles them out if CONFIG_EFI is not set.

I suppose we could also move these into arch/arm64/kernel/efi.c

Quoted 29 lines
---
 arch/arm64/kernel/fpsimd.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/kernel/fpsimd.c +4 -1
index 3a68cf3..f444f37 100644
@@ -321,6 +321,8 @@ void kernel_neon_end(void)
 }
 EXPORT_SYMBOL(kernel_neon_end);
 
+#ifdef CONFIG_EFI
+
 static DEFINE_PER_CPU(struct fpsimd_state, efi_fpsimd_state);
 static DEFINE_PER_CPU(bool, efi_fpsimd_state_used);
 
@@ -370,6 +372,8 @@ void __efi_fpsimd_end(void)
                kernel_neon_end();
 }
 
+#endif /* CONFIG_EFI */
+
 #endif /* CONFIG_KERNEL_MODE_NEON */
 
 #ifdef CONFIG_CPU_PM
--

2.1.4

#2 lore raw

PATCH 1/1 arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels

Quoted 9 lines · Ard Biesheuvel
Quoted 6 lines · Dave Martin

__efi_fpsimd_begin()/__efi_fpsimd_end() are for use when making EFI calls only, so using them in non-EFI kernels is not allowed.

This patch compiles them out if CONFIG_EFI is not set.

Thanks

Quoted 1 line

I suppose we could also move these into arch/arm64/kernel/efi.c

Could do, though I initially preferred to keep them in fpsimd.c due to the interactions with kernel-mode NEON.

I'll probably leave them where they are for now unless someone has a strong view on it.

Cheers
---Dave

maintainer Applied
#3 lore raw

PATCH 1/1 arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels

In reply to Dave Martin
Quoted 6 lines · Dave P Martin

__efi_fpsimd_begin()/__efi_fpsimd_end() are for use when making EFI calls only, so using them in non-EFI kernels is not allowed.

This patch compiles them out if CONFIG_EFI is not set.

Queued for 4.14. Thanks.

Signature · 1 line
Catalin