All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static
@ 2021-07-30 16:58 Mark Brown
  2021-08-02 15:52 ` Dave Martin
  2021-08-02 18:06 ` Catalin Marinas
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2021-07-30 16:58 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon; +Cc: linux-arm-kernel, Dave Martin, Mark Brown

This function is not referenced outside fpsimd.c so can be static, making
it that little bit easier to follow what is called from where.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 arch/arm64/include/asm/fpsimd.h | 1 -
 arch/arm64/kernel/fpsimd.c      | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
index c072161d5c65..9a62884183e5 100644
--- a/arch/arm64/include/asm/fpsimd.h
+++ b/arch/arm64/include/asm/fpsimd.h
@@ -45,7 +45,6 @@ extern void fpsimd_preserve_current_state(void);
 extern void fpsimd_restore_current_state(void);
 extern void fpsimd_update_current_state(struct user_fpsimd_state const *state);
 
-extern void fpsimd_bind_task_to_cpu(void);
 extern void fpsimd_bind_state_to_cpu(struct user_fpsimd_state *state,
 				     void *sve_state, unsigned int sve_vl);
 
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index e57b23f95284..eb8d972ad3d2 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -162,6 +162,8 @@ extern void __percpu *efi_sve_state;
 DEFINE_PER_CPU(bool, fpsimd_context_busy);
 EXPORT_PER_CPU_SYMBOL(fpsimd_context_busy);
 
+static void fpsimd_bind_task_to_cpu(void);
+
 static void __get_cpu_fpsimd_context(void)
 {
 	bool busy = __this_cpu_xchg(fpsimd_context_busy, true);
@@ -1112,7 +1114,7 @@ void fpsimd_signal_preserve_current_state(void)
  * The caller must have ownership of the cpu FPSIMD context before calling
  * this function.
  */
-void fpsimd_bind_task_to_cpu(void)
+static void fpsimd_bind_task_to_cpu(void)
 {
 	struct fpsimd_last_state_struct *last =
 		this_cpu_ptr(&fpsimd_last_state);
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static
  2021-07-30 16:58 [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static Mark Brown
@ 2021-08-02 15:52 ` Dave Martin
  2021-08-02 16:12   ` Mark Brown
  2021-08-02 18:06 ` Catalin Marinas
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Martin @ 2021-08-02 15:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: Catalin Marinas, Will Deacon, linux-arm-kernel

On Fri, Jul 30, 2021 at 05:58:46PM +0100, Mark Brown wrote:
> This function is not referenced outside fpsimd.c so can be static, making
> it that little bit easier to follow what is called from where.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Otherwise, this seems sensible, since by definition no code that isn't
switching task contexts should be calling this directly.

Rather makes me wonder
why it wasn't static in the first place.  This might have arisen from
splitting out a backend function from something else that isn't static,
or maybe I was trying to do this directy from KVM.  The notion of non-
task context that the KVM now uses is newer than the original SVE code.

Anyway, assuming you've grepped and tried to build with KVM at least
(so, defconfig):

Reviewed-by: Dave Martin <Dave.Martin@arm.com>


> ---
>  arch/arm64/include/asm/fpsimd.h | 1 -
>  arch/arm64/kernel/fpsimd.c      | 4 +++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
> index c072161d5c65..9a62884183e5 100644
> --- a/arch/arm64/include/asm/fpsimd.h
> +++ b/arch/arm64/include/asm/fpsimd.h
> @@ -45,7 +45,6 @@ extern void fpsimd_preserve_current_state(void);
>  extern void fpsimd_restore_current_state(void);
>  extern void fpsimd_update_current_state(struct user_fpsimd_state const *state);
>  
> -extern void fpsimd_bind_task_to_cpu(void);
>  extern void fpsimd_bind_state_to_cpu(struct user_fpsimd_state *state,
>  				     void *sve_state, unsigned int sve_vl);
>  
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index e57b23f95284..eb8d972ad3d2 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -162,6 +162,8 @@ extern void __percpu *efi_sve_state;
>  DEFINE_PER_CPU(bool, fpsimd_context_busy);
>  EXPORT_PER_CPU_SYMBOL(fpsimd_context_busy);
>  
> +static void fpsimd_bind_task_to_cpu(void);
> +
>  static void __get_cpu_fpsimd_context(void)
>  {
>  	bool busy = __this_cpu_xchg(fpsimd_context_busy, true);
> @@ -1112,7 +1114,7 @@ void fpsimd_signal_preserve_current_state(void)
>   * The caller must have ownership of the cpu FPSIMD context before calling
>   * this function.
>   */
> -void fpsimd_bind_task_to_cpu(void)
> +static void fpsimd_bind_task_to_cpu(void)
>  {
>  	struct fpsimd_last_state_struct *last =
>  		this_cpu_ptr(&fpsimd_last_state);
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static
  2021-08-02 15:52 ` Dave Martin
@ 2021-08-02 16:12   ` Mark Brown
  2021-08-02 16:16     ` Dave Martin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2021-08-02 16:12 UTC (permalink / raw)
  To: Dave Martin; +Cc: Catalin Marinas, Will Deacon, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 656 bytes --]

On Mon, Aug 02, 2021 at 04:52:38PM +0100, Dave Martin wrote:

> Rather makes me wonder
> why it wasn't static in the first place.  This might have arisen from
> splitting out a backend function from something else that isn't static,
> or maybe I was trying to do this directy from KVM.  The notion of non-
> task context that the KVM now uses is newer than the original SVE code.

IIRC there was something like that in the older KVM SVE stuff but I
didn't go spelunking enough to figure it out specifically.

> Anyway, assuming you've grepped and tried to build with KVM at least
> (so, defconfig):

grepped and my standard development builds include KVM.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static
  2021-08-02 16:12   ` Mark Brown
@ 2021-08-02 16:16     ` Dave Martin
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Martin @ 2021-08-02 16:16 UTC (permalink / raw)
  To: Mark Brown; +Cc: Catalin Marinas, Will Deacon, linux-arm-kernel

On Mon, Aug 02, 2021 at 05:12:01PM +0100, Mark Brown wrote:
> On Mon, Aug 02, 2021 at 04:52:38PM +0100, Dave Martin wrote:
> 
> > Rather makes me wonder
> > why it wasn't static in the first place.  This might have arisen from
> > splitting out a backend function from something else that isn't static,
> > or maybe I was trying to do this directy from KVM.  The notion of non-
> > task context that the KVM now uses is newer than the original SVE code.
> 
> IIRC there was something like that in the older KVM SVE stuff but I
> didn't go spelunking enough to figure it out specifically.

Probably best not to ;)

> 
> > Anyway, assuming you've grepped and tried to build with KVM at least
> > (so, defconfig):
> 
> grepped and my standard development builds include KVM.

Fair enough, I would have been very surprised if you hadn't already done
that.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static
  2021-07-30 16:58 [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static Mark Brown
  2021-08-02 15:52 ` Dave Martin
@ 2021-08-02 18:06 ` Catalin Marinas
  1 sibling, 0 replies; 5+ messages in thread
From: Catalin Marinas @ 2021-08-02 18:06 UTC (permalink / raw)
  To: Will Deacon, Mark Brown; +Cc: linux-arm-kernel, Dave Martin

On Fri, 30 Jul 2021 17:58:46 +0100, Mark Brown wrote:
> This function is not referenced outside fpsimd.c so can be static, making
> it that little bit easier to follow what is called from where.

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/sve: Make fpsimd_bind_task_to_cpu() static
      https://git.kernel.org/arm64/c/b24b5205099a

-- 
Catalin


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-08-02 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 16:58 [PATCH] arm64/sve: Make fpsimd_bind_task_to_cpu() static Mark Brown
2021-08-02 15:52 ` Dave Martin
2021-08-02 16:12   ` Mark Brown
2021-08-02 16:16     ` Dave Martin
2021-08-02 18:06 ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.