linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
@ 2017-08-31 15:33 Dave Martin
  2017-08-31 15:46 ` Ard Biesheuvel
  2017-09-07 16:29 ` Catalin Marinas
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Martin @ 2017-08-31 15:33 UTC (permalink / raw)
  To: linux-arm-kernel

__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.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
 arch/arm64/kernel/fpsimd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 3a68cf3..f444f37 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
  2017-08-31 15:33 [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels Dave Martin
@ 2017-08-31 15:46 ` Ard Biesheuvel
  2017-09-01  9:22   ` Dave Martin
  2017-09-07 16:29 ` Catalin Marinas
  1 sibling, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2017-08-31 15:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 31 August 2017 at 16:33, Dave Martin <Dave.Martin@arm.com> wrote:
> __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.
>
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

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

> ---
>  arch/arm64/kernel/fpsimd.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index 3a68cf3..f444f37 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
  2017-08-31 15:46 ` Ard Biesheuvel
@ 2017-09-01  9:22   ` Dave Martin
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Martin @ 2017-09-01  9:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 31, 2017 at 04:46:32PM +0100, Ard Biesheuvel wrote:
> On 31 August 2017 at 16:33, Dave Martin <Dave.Martin@arm.com> wrote:
> > __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.
> >
> > Signed-off-by: Dave Martin <Dave.Martin@arm.com>
> 
> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Thanks

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels
  2017-08-31 15:33 [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels Dave Martin
  2017-08-31 15:46 ` Ard Biesheuvel
@ 2017-09-07 16:29 ` Catalin Marinas
  1 sibling, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2017-09-07 16:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 31, 2017 at 04:33:26PM +0100, Dave P Martin wrote:
> __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.
> 
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>

Queued for 4.14. Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-07 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 15:33 [PATCH] arm64: efi: Don't include EFI fpsimd save/restore code in non-EFI kernels Dave Martin
2017-08-31 15:46 ` Ard Biesheuvel
2017-09-01  9:22   ` Dave Martin
2017-09-07 16:29 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).