* [PATCH] arm64/sve: Move sve_free() into SVE code section
@ 2022-05-17 14:52 ` Geert Uytterhoeven
0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-05-17 14:52 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Brown, Sebastian Andrzej Siewior
Cc: linux-arm-kernel, linux-kernel, Geert Uytterhoeven
If CONFIG_ARM64_SVE is not set:
arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
Fix this by moving sve_free() and __sve_free() into the existing section
protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
section has been removed.
Fixes: a1259dd807192917 ("arm64/sve: Delay freeing memory in fpsimd_flush_thread()")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm64/kernel/fpsimd.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index d994bf0a6ca93984..819979398127e6f3 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -281,23 +281,6 @@ static bool have_cpu_fpsimd_context(void)
return !preemptible() && __this_cpu_read(fpsimd_context_busy);
}
-/*
- * Call __sve_free() directly only if you know task can't be scheduled
- * or preempted.
- */
-static void __sve_free(struct task_struct *task)
-{
- kfree(task->thread.sve_state);
- task->thread.sve_state = NULL;
-}
-
-static void sve_free(struct task_struct *task)
-{
- WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
-
- __sve_free(task);
-}
-
unsigned int task_get_vl(const struct task_struct *task, enum vec_type type)
{
return task->thread.vl[type];
@@ -690,6 +673,22 @@ static void sve_to_fpsimd(struct task_struct *task)
}
#ifdef CONFIG_ARM64_SVE
+/*
+ * Call __sve_free() directly only if you know task can't be scheduled
+ * or preempted.
+ */
+static void __sve_free(struct task_struct *task)
+{
+ kfree(task->thread.sve_state);
+ task->thread.sve_state = NULL;
+}
+
+static void sve_free(struct task_struct *task)
+{
+ WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
+
+ __sve_free(task);
+}
/*
* Return how many bytes of memory are required to store the full SVE
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] arm64/sve: Move sve_free() into SVE code section
@ 2022-05-17 14:52 ` Geert Uytterhoeven
0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-05-17 14:52 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Mark Brown, Sebastian Andrzej Siewior
Cc: linux-arm-kernel, linux-kernel, Geert Uytterhoeven
If CONFIG_ARM64_SVE is not set:
arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
Fix this by moving sve_free() and __sve_free() into the existing section
protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
section has been removed.
Fixes: a1259dd807192917 ("arm64/sve: Delay freeing memory in fpsimd_flush_thread()")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm64/kernel/fpsimd.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index d994bf0a6ca93984..819979398127e6f3 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -281,23 +281,6 @@ static bool have_cpu_fpsimd_context(void)
return !preemptible() && __this_cpu_read(fpsimd_context_busy);
}
-/*
- * Call __sve_free() directly only if you know task can't be scheduled
- * or preempted.
- */
-static void __sve_free(struct task_struct *task)
-{
- kfree(task->thread.sve_state);
- task->thread.sve_state = NULL;
-}
-
-static void sve_free(struct task_struct *task)
-{
- WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
-
- __sve_free(task);
-}
-
unsigned int task_get_vl(const struct task_struct *task, enum vec_type type)
{
return task->thread.vl[type];
@@ -690,6 +673,22 @@ static void sve_to_fpsimd(struct task_struct *task)
}
#ifdef CONFIG_ARM64_SVE
+/*
+ * Call __sve_free() directly only if you know task can't be scheduled
+ * or preempted.
+ */
+static void __sve_free(struct task_struct *task)
+{
+ kfree(task->thread.sve_state);
+ task->thread.sve_state = NULL;
+}
+
+static void sve_free(struct task_struct *task)
+{
+ WARN_ON(test_tsk_thread_flag(task, TIF_SVE));
+
+ __sve_free(task);
+}
/*
* Return how many bytes of memory are required to store the full SVE
--
2.25.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] 6+ messages in thread
* Re: [PATCH] arm64/sve: Move sve_free() into SVE code section
2022-05-17 14:52 ` Geert Uytterhoeven
@ 2022-05-17 17:15 ` Mark Brown
-1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-05-17 17:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Catalin Marinas, Will Deacon, Sebastian Andrzej Siewior,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 446 bytes --]
On Tue, May 17, 2022 at 04:52:03PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_ARM64_SVE is not set:
>
> arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
>
> Fix this by moving sve_free() and __sve_free() into the existing section
> protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
> section has been removed.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/sve: Move sve_free() into SVE code section
@ 2022-05-17 17:15 ` Mark Brown
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2022-05-17 17:15 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Catalin Marinas, Will Deacon, Sebastian Andrzej Siewior,
linux-arm-kernel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 446 bytes --]
On Tue, May 17, 2022 at 04:52:03PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_ARM64_SVE is not set:
>
> arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
>
> Fix this by moving sve_free() and __sve_free() into the existing section
> protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
> section has been removed.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- 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] 6+ messages in thread
* Re: [PATCH] arm64/sve: Move sve_free() into SVE code section
2022-05-17 14:52 ` Geert Uytterhoeven
@ 2022-05-18 13:53 ` Catalin Marinas
-1 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2022-05-18 13:53 UTC (permalink / raw)
To: Mark Brown, Will Deacon, Sebastian Andrzej Siewior, Geert Uytterhoeven
Cc: linux-arm-kernel, linux-kernel
On Tue, 17 May 2022 16:52:03 +0200, Geert Uytterhoeven wrote:
> If CONFIG_ARM64_SVE is not set:
>
> arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
>
> Fix this by moving sve_free() and __sve_free() into the existing section
> protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
> section has been removed.
>
> [...]
Applied to arm64 (for-next/sme), thanks!
[1/1] arm64/sve: Move sve_free() into SVE code section
https://git.kernel.org/arm64/c/8e1f78a92101
--
Catalin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm64/sve: Move sve_free() into SVE code section
@ 2022-05-18 13:53 ` Catalin Marinas
0 siblings, 0 replies; 6+ messages in thread
From: Catalin Marinas @ 2022-05-18 13:53 UTC (permalink / raw)
To: Mark Brown, Will Deacon, Sebastian Andrzej Siewior, Geert Uytterhoeven
Cc: linux-arm-kernel, linux-kernel
On Tue, 17 May 2022 16:52:03 +0200, Geert Uytterhoeven wrote:
> If CONFIG_ARM64_SVE is not set:
>
> arch/arm64/kernel/fpsimd.c:294:13: warning: ‘sve_free’ defined but not used [-Wunused-function]
>
> Fix this by moving sve_free() and __sve_free() into the existing section
> protected by "#ifdef CONFIG_ARM64_SVE", now the last user outside that
> section has been removed.
>
> [...]
Applied to arm64 (for-next/sme), thanks!
[1/1] arm64/sve: Move sve_free() into SVE code section
https://git.kernel.org/arm64/c/8e1f78a92101
--
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] 6+ messages in thread
end of thread, other threads:[~2022-05-18 13:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 14:52 [PATCH] arm64/sve: Move sve_free() into SVE code section Geert Uytterhoeven
2022-05-17 14:52 ` Geert Uytterhoeven
2022-05-17 17:15 ` Mark Brown
2022-05-17 17:15 ` Mark Brown
2022-05-18 13:53 ` Catalin Marinas
2022-05-18 13:53 ` 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.