Skip to contentSkip to conversation

x86/asm: Provide a Kconfig symbol for disabling old assembly annotations

PATCH Applied Mark Brown 4 participants 4 messages Apr 16, 2020 – Apr 30, 2020

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 x86/asm: Provide a Kconfig symbol for disabling old assembly annotations

As x86 was converted to use the modern SYM_ annotations for assembly ifdefs were added to remove the generic definitions of the old style annotations on x86. Rather than collect a list of architectures in the ifdefs as more architectures are converted over provide a Kconfig symbol for this and update x86 to use it.

---

arm64 will all being well be able to use this shortly.

 arch/x86/Kconfig        | 1 +
 include/linux/linkage.h | 8 ++++----
 lib/Kconfig             | 3 +++
 3 files changed, 8 insertions(+), 4 deletions(-)
arch/x86/Kconfig +1 -0
index 5706d0c8377f..1c6f88cefc88 100644
@@ -92,6 +92,7 @@ config X86
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
+	select ARCH_USE_SYM_ANNOTATIONS
 	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
 	select ARCH_WANT_DEFAULT_BPF_JIT	if X86_64
 	select ARCH_WANTS_DYNAMIC_TASK_STRUCT
include/linux/linkage.h +4 -4
index 9280209d1f62..d796ec20d114 100644
@@ -105,7 +105,7 @@
 
 /* === DEPRECATED annotations === */
 
-#ifndef CONFIG_X86
+#ifndef CONFIG_ARCH_USE_SYM_ANNOTATIONS
 #ifndef GLOBAL
 /* deprecated, use SYM_DATA*, SYM_ENTRY, or similar */
 #define GLOBAL(name) \
@@ -118,10 +118,10 @@
 #define ENTRY(name) \
 	SYM_FUNC_START(name)
 #endif
-#endif /* CONFIG_X86 */
+#endif /* CONFIG_ARCH_USE_SYM_ANNOTATIONS */
 #endif /* LINKER_SCRIPT */
 
-#ifndef CONFIG_X86
+#ifndef CONFIG_ARCH_USE_SYM_ANNOTATIONS
 #ifndef WEAK
 /* deprecated, use SYM_FUNC_START_WEAK* */
 #define WEAK(name)	   \
@@ -143,7 +143,7 @@
 #define ENDPROC(name) \
 	SYM_FUNC_END(name)
 #endif
-#endif /* CONFIG_X86 */
+#endif /* CONFIG_ARCH_USE_SYM_ANNOTATIONS */
 
 /* === generic annotations === */
 
lib/Kconfig +3 -0
index 5d53f9609c25..e831e1f01767 100644
@@ -80,6 +80,9 @@ config ARCH_USE_CMPXCHG_LOCKREF
 config ARCH_HAS_FAST_MULTIPLIER
 	bool
 
+config ARCH_USE_SYM_ANNOTATIONS
+	bool
+
 config INDIRECT_PIO
 	bool "Access I/O in non-MMIO mode"
 	depends on ARM64
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mark Brown

As x86 was converted to use the modern SYM_ annotations for assembly ifdefs were added to remove the generic definitions of the old style annotations on x86. Rather than collect a list of architectures in the ifdefs as more architectures are converted over provide a Kconfig symbol for this and update x86 to use it.

Quoted 14 lines

---

arm64 will all being well be able to use this shortly.

 arch/x86/Kconfig        | 1 +
 include/linux/linkage.h | 8 ++++----
 lib/Kconfig             | 3 +++
 3 files changed, 8 insertions(+), 4 deletions(-)
arch/x86/Kconfig +0 -0
index 5706d0c8377f..1c6f88cefc88 100644

arch/x86/Kconfig config X86 · line 98

Quoted 7 lines
arch/x86/Kconfig +1 -0
@@ -92,6 +92,7 @@ config X86
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
+	select ARCH_USE_SYM_ANNOTATIONS
 	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
 	select ARCH_WANT_DEFAULT_BPF_JIT	if X86_64
 	select ARCH_WANTS_DYNAMIC_TASK_STRUCT

...
thanks,

Signature · 2 lines
js
suse labs
merge bot Applied
#2 lore raw
In reply to Mark Brown
The following commit has been merged into the x86/asm branch of tip:

The following commit has been merged into the x86/asm branch of tip:

Commit-ID:     2ce0d7f9766f0e49bb54f149c77bae89464932fb
Gitweb:        https://git.kernel.org/tip/2ce0d7f9766f0e49bb54f149c77bae89464932fb
Author:        Mark Brown <[email protected]>
AuthorDate:    Thu, 16 Apr 2020 19:24:02 +01:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Sat, 18 Apr 2020 17:43:09 +02:00

x86/asm: Provide a Kconfig symbol for disabling old assembly annotations

As x86 was converted to use the modern SYM_ annotations for assembly, ifdefs were added to remove the generic definitions of the old style annotations on x86. Rather than collect a list of architectures in the ifdefs as more architectures are converted over, provide a Kconfig symbol for this and update x86 to use it.

---
 arch/x86/Kconfig        | 1 +
 include/linux/linkage.h | 8 ++++----
 lib/Kconfig             | 3 +++
 3 files changed, 8 insertions(+), 4 deletions(-)
arch/x86/Kconfig +1 -0
index 1d6104e..e3d22ed 100644
@@ -91,6 +91,7 @@ config X86
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_QUEUED_RWLOCKS
 	select ARCH_USE_QUEUED_SPINLOCKS
+	select ARCH_USE_SYM_ANNOTATIONS
 	select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH
 	select ARCH_WANT_DEFAULT_BPF_JIT	if X86_64
 	select ARCH_WANTS_DYNAMIC_TASK_STRUCT
include/linux/linkage.h +4 -4
index 9280209..d796ec2 100644
@@ -105,7 +105,7 @@
 
 /* === DEPRECATED annotations === */
 
-#ifndef CONFIG_X86
+#ifndef CONFIG_ARCH_USE_SYM_ANNOTATIONS
 #ifndef GLOBAL
 /* deprecated, use SYM_DATA*, SYM_ENTRY, or similar */
 #define GLOBAL(name) \
@@ -118,10 +118,10 @@
 #define ENTRY(name) \
 	SYM_FUNC_START(name)
 #endif
-#endif /* CONFIG_X86 */
+#endif /* CONFIG_ARCH_USE_SYM_ANNOTATIONS */
 #endif /* LINKER_SCRIPT */
 
-#ifndef CONFIG_X86
+#ifndef CONFIG_ARCH_USE_SYM_ANNOTATIONS
 #ifndef WEAK
 /* deprecated, use SYM_FUNC_START_WEAK* */
 #define WEAK(name)	   \
@@ -143,7 +143,7 @@
 #define ENDPROC(name) \
 	SYM_FUNC_END(name)
 #endif
-#endif /* CONFIG_X86 */
+#endif /* CONFIG_ARCH_USE_SYM_ANNOTATIONS */
 
 /* === generic annotations === */
 
lib/Kconfig +3 -0
index 5d53f96..e831e1f 100644
@@ -80,6 +80,9 @@ config ARCH_USE_CMPXCHG_LOCKREF
 config ARCH_HAS_FAST_MULTIPLIER
 	bool
 
+config ARCH_USE_SYM_ANNOTATIONS
+	bool
+
 config INDIRECT_PIO
 	bool "Access I/O in non-MMIO mode"
 	depends on ARM64
#3 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown

As x86 was converted to use the modern SYM_ annotations for assembly ifdefs were added to remove the generic definitions of the old style annotations on x86. Rather than collect a list of architectures in the ifdefs as more architectures are converted over provide a Kconfig symbol for this and update x86 to use it.

---

arm64 will all being well be able to use this shortly.

Just for the record (already discussed with Boris off-list), I'm going to queue this in the arm64 tree by pulling the x86/asm branch from -tip.

Thanks,

Will