* [PATCH] arm64/sve: Add compile time checks for SVE hooks in generic functions
@ 2021-04-15 12:17 Mark Brown
2021-04-15 13:06 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2021-04-15 12:17 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: linux-arm-kernel, Mark Brown, kernel test robot
The FPSIMD code was relying on IS_ENABLED() checks in system_suppors_sve()
to cause the compiler to delete references to SVE functions in some places,
add explicit IS_ENABLED() checks back.
Fixes: ef9c5d09797db874a2 (arm64/sve: Remove redundant system_supports_sve() tests)
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/kernel/fpsimd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index f6cd89131dc3..ad3dd34a83cf 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -285,7 +285,7 @@ static void task_fpsimd_load(void)
WARN_ON(!system_supports_fpsimd());
WARN_ON(!have_cpu_fpsimd_context());
- if (test_thread_flag(TIF_SVE))
+ if (IS_ENABLED(CONFIG_ARM64_SVE) && test_thread_flag(TIF_SVE))
sve_load_state(sve_pffr(¤t->thread),
¤t->thread.uw.fpsimd_state.fpsr,
sve_vq_from_vl(current->thread.sve_vl) - 1);
@@ -307,7 +307,8 @@ static void fpsimd_save(void)
WARN_ON(!have_cpu_fpsimd_context());
if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) {
- if (test_thread_flag(TIF_SVE)) {
+ if (IS_ENABLED(CONFIG_ARM64_SVE) &&
+ test_thread_flag(TIF_SVE)) {
if (WARN_ON(sve_get_vl() != last->sve_vl)) {
/*
* Can't save the user regs, so current would
--
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] 2+ messages in thread
* Re: [PATCH] arm64/sve: Add compile time checks for SVE hooks in generic functions
2021-04-15 12:17 [PATCH] arm64/sve: Add compile time checks for SVE hooks in generic functions Mark Brown
@ 2021-04-15 13:06 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2021-04-15 13:06 UTC (permalink / raw)
To: Mark Brown, Will Deacon
Cc: Catalin Marinas, linux-arm-kernel, kernel test robot
On Thu, 15 Apr 2021 13:17:42 +0100, Mark Brown wrote:
> The FPSIMD code was relying on IS_ENABLED() checks in system_suppors_sve()
> to cause the compiler to delete references to SVE functions in some places,
> add explicit IS_ENABLED() checks back.
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64/sve: Add compile time checks for SVE hooks in generic functions
https://git.kernel.org/arm64/c/087dfa5ca7d8
--
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] 2+ messages in thread
end of thread, other threads:[~2021-04-15 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 12:17 [PATCH] arm64/sve: Add compile time checks for SVE hooks in generic functions Mark Brown
2021-04-15 13:06 ` 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).