Skip to contentSkip to conversation

arm64/sve: Fixups for !SVE builds

PATCH Applied Mark Brown 2 participants 4 messages Oct 22, 2021 – Oct 26, 2021 arm64

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover arm64/sve: Fixups for !SVE builds

A couple of build fixups for !SVE issues reported by Catalin.

Mark Brown (2):
arm64/sve: Add stub for sve_max_virtualisable_vl() arm64/sve: Fix warnings when SVE is disabled

 arch/arm64/include/asm/fpsimd.h |  5 +++++
 arch/arm64/kernel/fpsimd.c      | 12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

base-commit: 5838a155798479e3fe7e1482a31f0db657d5bbdd

Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#1 lore raw

PATCH 1/2 arm64/sve: Add stub for sve_max_virtualisable_vl()

Fixes build problems for configurations with KVM enabled but SVE disabled.

---
 arch/arm64/include/asm/fpsimd.h | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/include/asm/fpsimd.h +5 -0
index 1d0b5fa253a0..dbb4b30a5648 100644
@@ -215,6 +215,11 @@ static inline void fpsimd_release_task(struct task_struct *task) { }
 static inline void sve_sync_to_fpsimd(struct task_struct *task) { }
 static inline void sve_sync_from_fpsimd_zeropad(struct task_struct *task) { }
 
+static inline int sve_max_virtualisable_vl(void)
+{
+	return 0;
+}
+
 static inline int sve_set_current_vl(unsigned long arg)
 {
 	return -EINVAL;
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#2 lore raw

PATCH 2/2 arm64/sve: Fix warnings when SVE is disabled

In reply to Mark Brown

In configurations where SVE is disabled we define but never reference the functions for retrieving the default vector length, causing warnings. Fix this by move the ifdef up, marking get_default_vl() inline since it is referenced from code guarded by an IS_ENABLED() check, and do the same for the other accessors for consistency.

---
 arch/arm64/kernel/fpsimd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/kernel/fpsimd.c +6 -6
index 3474122f9207..fa244c426f61 100644
@@ -150,24 +150,24 @@ struct vl_config {
 
 static struct vl_config vl_config[ARM64_VEC_MAX];
 
-static int get_default_vl(enum vec_type type)
+static inline int get_default_vl(enum vec_type type)
 {
 	return READ_ONCE(vl_config[type].__default_vl);
 }
 
-static int get_sve_default_vl(void)
+#ifdef CONFIG_ARM64_SVE
+
+static inline int get_sve_default_vl(void)
 {
 	return get_default_vl(ARM64_VEC_SVE);
 }
 
-#ifdef CONFIG_ARM64_SVE
-
-static void set_default_vl(enum vec_type type, int val)
+static inline void set_default_vl(enum vec_type type, int val)
 {
 	WRITE_ONCE(vl_config[type].__default_vl, val);
 }
 
-static void set_sve_default_vl(int val)
+static inline void set_sve_default_vl(int val)
 {
 	set_default_vl(ARM64_VEC_SVE, val);
 }
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#3 lore raw
In reply to Mark Brown
Quoted 11 lines · Mark Brown

A couple of build fixups for !SVE issues reported by Catalin.

Mark Brown (2):
arm64/sve: Add stub for sve_max_virtualisable_vl() arm64/sve: Fix warnings when SVE is disabled

 arch/arm64/include/asm/fpsimd.h |  5 +++++
 arch/arm64/kernel/fpsimd.c      | 12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

[...]

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

[1/2] arm64/sve: Add stub for sve_max_virtualisable_vl()

      https://git.kernel.org/arm64/c/49ed920408f8
[2/2] arm64/sve: Fix warnings when SVE is disabled
      https://git.kernel.org/arm64/c/04ee53a55543

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel