arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
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
@@ -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
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_EFIis not set.Signed-off-by Dave Martin <[email protected]>
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@@ -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
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_EFIis not set.Signed-off-by Dave Martin <[email protected]>Acked-by Ard Biesheuvel <[email protected]>
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
PATCH 1/1 arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
In reply to Dave MartinQuoted 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_EFIis not set.Signed-off-by Dave Martin <[email protected]>
Queued for 4.14. Thanks.
Signature · 1 line
Catalin