linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] treewide: Remove stringification from __alias macro definition
@ 2020-10-21 18:58 Joe Perches
  2020-10-21 19:02 ` Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Joe Perches @ 2020-10-21 18:58 UTC (permalink / raw)
  To: Thomas Gleixner, Borislav Petkov, x86, H. Peter Anvin,
	Ard Biesheuvel, Miguel Ojeda, Marco Elver, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers
  Cc: linux-kernel, linux-efi, kasan-dev, linux-crypto, linux-mm

Like the __section macro, the __alias macro uses
macro # stringification to create quotes around
the section name used in the __attribute__.

Remove the stringification and add quotes or a
stringification to the uses instead.

Signed-off-by: Joe Perches <joe@perches.com>
---

There is a script that might eventually be applied
to convert the __section macro definition and uses
to remove stringification

https://lore.kernel.org/lkml/46f69161e60b802488ba8c8f3f8bbf922aa3b49b.camel@perches.com/
https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/

This patch is intended to create commonality
between the uses of __section and __alias.

 arch/x86/boot/compressed/string.c       |  6 +++---
 arch/x86/include/asm/syscall_wrapper.h  |  2 +-
 drivers/firmware/efi/runtime-wrappers.c |  2 +-
 include/linux/compiler_attributes.h     |  2 +-
 kernel/kcsan/core.c                     | 10 +++++-----
 lib/crc32.c                             |  4 ++--
 lib/crypto/aes.c                        |  4 ++--
 mm/kasan/generic.c                      |  8 ++++----
 8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index 81fc1eaa3229..d38b122f51ef 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -75,7 +75,7 @@ void *memcpy(void *dest, const void *src, size_t n)
 }
 
 #ifdef CONFIG_KASAN
-extern void *__memset(void *s, int c, size_t n) __alias(memset);
-extern void *__memmove(void *dest, const void *src, size_t n) __alias(memmove);
-extern void *__memcpy(void *dest, const void *src, size_t n) __alias(memcpy);
+extern void *__memset(void *s, int c, size_t n) __alias("memset");
+extern void *__memmove(void *dest, const void *src, size_t n) __alias("memmove");
+extern void *__memcpy(void *dest, const void *src, size_t n) __alias("memcpy");
 #endif
diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h
index a84333adeef2..f19d1bbbff3d 100644
--- a/arch/x86/include/asm/syscall_wrapper.h
+++ b/arch/x86/include/asm/syscall_wrapper.h
@@ -69,7 +69,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
 	long __##abi##_##name(const struct pt_regs *regs);		\
 	ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO);			\
 	long __##abi##_##name(const struct pt_regs *regs)		\
-		__alias(__do_##name);
+		__alias("__do_" #name);
 
 #define __SYS_STUBx(abi, name, ...)					\
 	long __##abi##_##name(const struct pt_regs *regs);		\
diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
index 1410beaef5c3..14e380ac65d4 100644
--- a/drivers/firmware/efi/runtime-wrappers.c
+++ b/drivers/firmware/efi/runtime-wrappers.c
@@ -162,7 +162,7 @@ static DEFINE_SEMAPHORE(efi_runtime_lock);
  * Expose the EFI runtime lock to the UV platform
  */
 #ifdef CONFIG_X86_UV
-extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
+extern struct semaphore __efi_uv_runtime_lock __alias("efi_runtime_lock");
 #endif
 
 /*
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index ea7b756b1c8f..4819512c9abd 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -42,7 +42,7 @@
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
  */
-#define __alias(symbol)                 __attribute__((__alias__(#symbol)))
+#define __alias(symbol)                 __attribute__((__alias__(symbol)))
 
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
index 3994a217bde7..465f6cfc317c 100644
--- a/kernel/kcsan/core.c
+++ b/kernel/kcsan/core.c
@@ -814,7 +814,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
 	}                                                                      \
 	EXPORT_SYMBOL(__tsan_read##size);                                      \
 	void __tsan_unaligned_read##size(void *ptr)                            \
-		__alias(__tsan_read##size);                                    \
+		__alias("__tsan_read" #size);                                  \
 	EXPORT_SYMBOL(__tsan_unaligned_read##size);                            \
 	void __tsan_write##size(void *ptr);                                    \
 	void __tsan_write##size(void *ptr)                                     \
@@ -823,7 +823,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
 	}                                                                      \
 	EXPORT_SYMBOL(__tsan_write##size);                                     \
 	void __tsan_unaligned_write##size(void *ptr)                           \
-		__alias(__tsan_write##size);                                   \
+		__alias("__tsan_write" #size);                                 \
 	EXPORT_SYMBOL(__tsan_unaligned_write##size);                           \
 	void __tsan_read_write##size(void *ptr);                               \
 	void __tsan_read_write##size(void *ptr)                                \
@@ -833,7 +833,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
 	}                                                                      \
 	EXPORT_SYMBOL(__tsan_read_write##size);                                \
 	void __tsan_unaligned_read_write##size(void *ptr)                      \
-		__alias(__tsan_read_write##size);                              \
+		__alias("__tsan_read_write" #size);                            \
 	EXPORT_SYMBOL(__tsan_unaligned_read_write##size)
 
 DEFINE_TSAN_READ_WRITE(1);
@@ -877,7 +877,7 @@ EXPORT_SYMBOL(__tsan_write_range);
 	}                                                                      \
 	EXPORT_SYMBOL(__tsan_volatile_read##size);                             \
 	void __tsan_unaligned_volatile_read##size(void *ptr)                   \
-		__alias(__tsan_volatile_read##size);                           \
+		__alias("__tsan_volatile_read" #size);                         \
 	EXPORT_SYMBOL(__tsan_unaligned_volatile_read##size);                   \
 	void __tsan_volatile_write##size(void *ptr);                           \
 	void __tsan_volatile_write##size(void *ptr)                            \
@@ -892,7 +892,7 @@ EXPORT_SYMBOL(__tsan_write_range);
 	}                                                                      \
 	EXPORT_SYMBOL(__tsan_volatile_write##size);                            \
 	void __tsan_unaligned_volatile_write##size(void *ptr)                  \
-		__alias(__tsan_volatile_write##size);                          \
+		__alias("__tsan_volatile_write" #size);                        \
 	EXPORT_SYMBOL(__tsan_unaligned_volatile_write##size)
 
 DEFINE_TSAN_VOLATILE_READ_WRITE(1);
diff --git a/lib/crc32.c b/lib/crc32.c
index 2a68dfd3b96c..373a17aaa432 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -206,8 +206,8 @@ u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len)
 EXPORT_SYMBOL(crc32_le);
 EXPORT_SYMBOL(__crc32c_le);
 
-u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le);
-u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le);
+u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias("crc32_le");
+u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias("__crc32c_le");
 
 /*
  * This multiplies the polynomials x and y modulo the given modulus.
diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c
index 827fe89922ff..5b80514595c2 100644
--- a/lib/crypto/aes.c
+++ b/lib/crypto/aes.c
@@ -82,8 +82,8 @@ static volatile const u8 __cacheline_aligned aes_inv_sbox[] = {
 	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
 };
 
-extern const u8 crypto_aes_sbox[256] __alias(aes_sbox);
-extern const u8 crypto_aes_inv_sbox[256] __alias(aes_inv_sbox);
+extern const u8 crypto_aes_sbox[256] __alias("aes_sbox");
+extern const u8 crypto_aes_inv_sbox[256] __alias("aes_inv_sbox");
 
 EXPORT_SYMBOL(crypto_aes_sbox);
 EXPORT_SYMBOL(crypto_aes_inv_sbox);
diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
index 248264b9cb76..4496f897e4f5 100644
--- a/mm/kasan/generic.c
+++ b/mm/kasan/generic.c
@@ -234,7 +234,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
 		check_memory_region_inline(addr, size, false, _RET_IP_);\
 	}								\
 	EXPORT_SYMBOL(__asan_load##size);				\
-	__alias(__asan_load##size)					\
+	__alias("__asan_load" #size)					\
 	void __asan_load##size##_noabort(unsigned long);		\
 	EXPORT_SYMBOL(__asan_load##size##_noabort);			\
 	void __asan_store##size(unsigned long addr)			\
@@ -242,7 +242,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
 		check_memory_region_inline(addr, size, true, _RET_IP_);	\
 	}								\
 	EXPORT_SYMBOL(__asan_store##size);				\
-	__alias(__asan_store##size)					\
+	__alias("__asan_store" #size)					\
 	void __asan_store##size##_noabort(unsigned long);		\
 	EXPORT_SYMBOL(__asan_store##size##_noabort)
 
@@ -258,7 +258,7 @@ void __asan_loadN(unsigned long addr, size_t size)
 }
 EXPORT_SYMBOL(__asan_loadN);
 
-__alias(__asan_loadN)
+__alias("__asan_loadN")
 void __asan_loadN_noabort(unsigned long, size_t);
 EXPORT_SYMBOL(__asan_loadN_noabort);
 
@@ -268,7 +268,7 @@ void __asan_storeN(unsigned long addr, size_t size)
 }
 EXPORT_SYMBOL(__asan_storeN);
 
-__alias(__asan_storeN)
+__alias("__asan_storeN")
 void __asan_storeN_noabort(unsigned long, size_t);
 EXPORT_SYMBOL(__asan_storeN_noabort);
 





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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 18:58 [PATCH -next] treewide: Remove stringification from __alias macro definition Joe Perches
@ 2020-10-21 19:02 ` Ard Biesheuvel
  2020-10-21 19:07   ` Joe Perches
  2020-10-21 21:18   ` David Laight
  2020-10-21 19:20 ` Marco Elver
  2020-10-22  7:33 ` Peter Zijlstra
  2 siblings, 2 replies; 12+ messages in thread
From: Ard Biesheuvel @ 2020-10-21 19:02 UTC (permalink / raw)
  To: Joe Perches
  Cc: Thomas Gleixner, Borislav Petkov, X86 ML, H. Peter Anvin,
	Miguel Ojeda, Marco Elver, Dmitry Vyukov, Herbert Xu,
	David S. Miller, Andrey Ryabinin, Alexander Potapenko,
	Andrew Morton, Nick Desaulniers, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
>
> Like the __section macro, the __alias macro uses
> macro # stringification to create quotes around
> the section name used in the __attribute__.
>
> Remove the stringification and add quotes or a
> stringification to the uses instead.
>

Why?

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>
> There is a script that might eventually be applied
> to convert the __section macro definition and uses
> to remove stringification
>
> https://lore.kernel.org/lkml/46f69161e60b802488ba8c8f3f8bbf922aa3b49b.camel@perches.com/
> https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/
>
> This patch is intended to create commonality
> between the uses of __section and __alias.
>
>  arch/x86/boot/compressed/string.c       |  6 +++---
>  arch/x86/include/asm/syscall_wrapper.h  |  2 +-
>  drivers/firmware/efi/runtime-wrappers.c |  2 +-
>  include/linux/compiler_attributes.h     |  2 +-
>  kernel/kcsan/core.c                     | 10 +++++-----
>  lib/crc32.c                             |  4 ++--
>  lib/crypto/aes.c                        |  4 ++--
>  mm/kasan/generic.c                      |  8 ++++----
>  8 files changed, 19 insertions(+), 19 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
> index 81fc1eaa3229..d38b122f51ef 100644
> --- a/arch/x86/boot/compressed/string.c
> +++ b/arch/x86/boot/compressed/string.c
> @@ -75,7 +75,7 @@ void *memcpy(void *dest, const void *src, size_t n)
>  }
>
>  #ifdef CONFIG_KASAN
> -extern void *__memset(void *s, int c, size_t n) __alias(memset);
> -extern void *__memmove(void *dest, const void *src, size_t n) __alias(memmove);
> -extern void *__memcpy(void *dest, const void *src, size_t n) __alias(memcpy);
> +extern void *__memset(void *s, int c, size_t n) __alias("memset");
> +extern void *__memmove(void *dest, const void *src, size_t n) __alias("memmove");
> +extern void *__memcpy(void *dest, const void *src, size_t n) __alias("memcpy");
>  #endif
> diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h
> index a84333adeef2..f19d1bbbff3d 100644
> --- a/arch/x86/include/asm/syscall_wrapper.h
> +++ b/arch/x86/include/asm/syscall_wrapper.h
> @@ -69,7 +69,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
>         long __##abi##_##name(const struct pt_regs *regs);              \
>         ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO);                 \
>         long __##abi##_##name(const struct pt_regs *regs)               \
> -               __alias(__do_##name);
> +               __alias("__do_" #name);
>
>  #define __SYS_STUBx(abi, name, ...)                                    \
>         long __##abi##_##name(const struct pt_regs *regs);              \
> diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
> index 1410beaef5c3..14e380ac65d4 100644
> --- a/drivers/firmware/efi/runtime-wrappers.c
> +++ b/drivers/firmware/efi/runtime-wrappers.c
> @@ -162,7 +162,7 @@ static DEFINE_SEMAPHORE(efi_runtime_lock);
>   * Expose the EFI runtime lock to the UV platform
>   */
>  #ifdef CONFIG_X86_UV
> -extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
> +extern struct semaphore __efi_uv_runtime_lock __alias("efi_runtime_lock");
>  #endif
>
>  /*
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index ea7b756b1c8f..4819512c9abd 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -42,7 +42,7 @@
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
>   */
> -#define __alias(symbol)                 __attribute__((__alias__(#symbol)))
> +#define __alias(symbol)                 __attribute__((__alias__(symbol)))
>
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
> diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
> index 3994a217bde7..465f6cfc317c 100644
> --- a/kernel/kcsan/core.c
> +++ b/kernel/kcsan/core.c
> @@ -814,7 +814,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_read##size);                                      \
>         void __tsan_unaligned_read##size(void *ptr)                            \
> -               __alias(__tsan_read##size);                                    \
> +               __alias("__tsan_read" #size);                                  \
>         EXPORT_SYMBOL(__tsan_unaligned_read##size);                            \
>         void __tsan_write##size(void *ptr);                                    \
>         void __tsan_write##size(void *ptr)                                     \
> @@ -823,7 +823,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_write##size);                                     \
>         void __tsan_unaligned_write##size(void *ptr)                           \
> -               __alias(__tsan_write##size);                                   \
> +               __alias("__tsan_write" #size);                                 \
>         EXPORT_SYMBOL(__tsan_unaligned_write##size);                           \
>         void __tsan_read_write##size(void *ptr);                               \
>         void __tsan_read_write##size(void *ptr)                                \
> @@ -833,7 +833,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_read_write##size);                                \
>         void __tsan_unaligned_read_write##size(void *ptr)                      \
> -               __alias(__tsan_read_write##size);                              \
> +               __alias("__tsan_read_write" #size);                            \
>         EXPORT_SYMBOL(__tsan_unaligned_read_write##size)
>
>  DEFINE_TSAN_READ_WRITE(1);
> @@ -877,7 +877,7 @@ EXPORT_SYMBOL(__tsan_write_range);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_volatile_read##size);                             \
>         void __tsan_unaligned_volatile_read##size(void *ptr)                   \
> -               __alias(__tsan_volatile_read##size);                           \
> +               __alias("__tsan_volatile_read" #size);                         \
>         EXPORT_SYMBOL(__tsan_unaligned_volatile_read##size);                   \
>         void __tsan_volatile_write##size(void *ptr);                           \
>         void __tsan_volatile_write##size(void *ptr)                            \
> @@ -892,7 +892,7 @@ EXPORT_SYMBOL(__tsan_write_range);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_volatile_write##size);                            \
>         void __tsan_unaligned_volatile_write##size(void *ptr)                  \
> -               __alias(__tsan_volatile_write##size);                          \
> +               __alias("__tsan_volatile_write" #size);                        \
>         EXPORT_SYMBOL(__tsan_unaligned_volatile_write##size)
>
>  DEFINE_TSAN_VOLATILE_READ_WRITE(1);
> diff --git a/lib/crc32.c b/lib/crc32.c
> index 2a68dfd3b96c..373a17aaa432 100644
> --- a/lib/crc32.c
> +++ b/lib/crc32.c
> @@ -206,8 +206,8 @@ u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len)
>  EXPORT_SYMBOL(crc32_le);
>  EXPORT_SYMBOL(__crc32c_le);
>
> -u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le);
> -u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le);
> +u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias("crc32_le");
> +u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias("__crc32c_le");
>
>  /*
>   * This multiplies the polynomials x and y modulo the given modulus.
> diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c
> index 827fe89922ff..5b80514595c2 100644
> --- a/lib/crypto/aes.c
> +++ b/lib/crypto/aes.c
> @@ -82,8 +82,8 @@ static volatile const u8 __cacheline_aligned aes_inv_sbox[] = {
>         0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
>  };
>
> -extern const u8 crypto_aes_sbox[256] __alias(aes_sbox);
> -extern const u8 crypto_aes_inv_sbox[256] __alias(aes_inv_sbox);
> +extern const u8 crypto_aes_sbox[256] __alias("aes_sbox");
> +extern const u8 crypto_aes_inv_sbox[256] __alias("aes_inv_sbox");
>
>  EXPORT_SYMBOL(crypto_aes_sbox);
>  EXPORT_SYMBOL(crypto_aes_inv_sbox);
> diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
> index 248264b9cb76..4496f897e4f5 100644
> --- a/mm/kasan/generic.c
> +++ b/mm/kasan/generic.c
> @@ -234,7 +234,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
>                 check_memory_region_inline(addr, size, false, _RET_IP_);\
>         }                                                               \
>         EXPORT_SYMBOL(__asan_load##size);                               \
> -       __alias(__asan_load##size)                                      \
> +       __alias("__asan_load" #size)                                    \
>         void __asan_load##size##_noabort(unsigned long);                \
>         EXPORT_SYMBOL(__asan_load##size##_noabort);                     \
>         void __asan_store##size(unsigned long addr)                     \
> @@ -242,7 +242,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
>                 check_memory_region_inline(addr, size, true, _RET_IP_); \
>         }                                                               \
>         EXPORT_SYMBOL(__asan_store##size);                              \
> -       __alias(__asan_store##size)                                     \
> +       __alias("__asan_store" #size)                                   \
>         void __asan_store##size##_noabort(unsigned long);               \
>         EXPORT_SYMBOL(__asan_store##size##_noabort)
>
> @@ -258,7 +258,7 @@ void __asan_loadN(unsigned long addr, size_t size)
>  }
>  EXPORT_SYMBOL(__asan_loadN);
>
> -__alias(__asan_loadN)
> +__alias("__asan_loadN")
>  void __asan_loadN_noabort(unsigned long, size_t);
>  EXPORT_SYMBOL(__asan_loadN_noabort);
>
> @@ -268,7 +268,7 @@ void __asan_storeN(unsigned long addr, size_t size)
>  }
>  EXPORT_SYMBOL(__asan_storeN);
>
> -__alias(__asan_storeN)
> +__alias("__asan_storeN")
>  void __asan_storeN_noabort(unsigned long, size_t);
>  EXPORT_SYMBOL(__asan_storeN_noabort);
>
>
>
>
>

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 19:02 ` Ard Biesheuvel
@ 2020-10-21 19:07   ` Joe Perches
  2020-10-21 19:09     ` Ard Biesheuvel
                       ` (2 more replies)
  2020-10-21 21:18   ` David Laight
  1 sibling, 3 replies; 12+ messages in thread
From: Joe Perches @ 2020-10-21 19:07 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Thomas Gleixner, Borislav Petkov, X86 ML, H. Peter Anvin,
	Miguel Ojeda, Marco Elver, Dmitry Vyukov, Herbert Xu,
	David S. Miller, Andrey Ryabinin, Alexander Potapenko,
	Andrew Morton, Nick Desaulniers, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

On Wed, 2020-10-21 at 21:02 +0200, Ard Biesheuvel wrote:
> On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
> > Like the __section macro, the __alias macro uses
> > macro # stringification to create quotes around
> > the section name used in the __attribute__.
> > 
> > Remove the stringification and add quotes or a
> > stringification to the uses instead.
> > 
> 
> Why?

Using quotes in __section caused/causes differences
between clang and gcc.

https://lkml.org/lkml/2020/9/29/2187

Using common styles for details like this is good.



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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 19:07   ` Joe Perches
@ 2020-10-21 19:09     ` Ard Biesheuvel
  2020-10-21 19:23     ` Miguel Ojeda
  2020-10-21 20:23     ` Nick Desaulniers
  2 siblings, 0 replies; 12+ messages in thread
From: Ard Biesheuvel @ 2020-10-21 19:09 UTC (permalink / raw)
  To: Joe Perches
  Cc: Thomas Gleixner, Borislav Petkov, X86 ML, H. Peter Anvin,
	Miguel Ojeda, Marco Elver, Dmitry Vyukov, Herbert Xu,
	David S. Miller, Andrey Ryabinin, Alexander Potapenko,
	Andrew Morton, Nick Desaulniers, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

On Wed, 21 Oct 2020 at 21:07, Joe Perches <joe@perches.com> wrote:
>
> On Wed, 2020-10-21 at 21:02 +0200, Ard Biesheuvel wrote:
> > On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
> > > Like the __section macro, the __alias macro uses
> > > macro # stringification to create quotes around
> > > the section name used in the __attribute__.
> > >
> > > Remove the stringification and add quotes or a
> > > stringification to the uses instead.
> > >
> >
> > Why?
>
> Using quotes in __section caused/causes differences
> between clang and gcc.
>
> https://lkml.org/lkml/2020/9/29/2187
>
> Using common styles for details like this is good.
>
>

Ah, fair enough.

With this rationale added to the commit log:

Acked-by: Ard Biesheuvel <ardb@kernel.org>

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 18:58 [PATCH -next] treewide: Remove stringification from __alias macro definition Joe Perches
  2020-10-21 19:02 ` Ard Biesheuvel
@ 2020-10-21 19:20 ` Marco Elver
  2020-10-22  7:33 ` Peter Zijlstra
  2 siblings, 0 replies; 12+ messages in thread
From: Marco Elver @ 2020-10-21 19:20 UTC (permalink / raw)
  To: Joe Perches
  Cc: Thomas Gleixner, Borislav Petkov, the arch/x86 maintainers,
	H. Peter Anvin, Ard Biesheuvel, Miguel Ojeda, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers, LKML,
	linux-efi, kasan-dev,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, linux-mm,
	Andrey Konovalov

On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
>
> Like the __section macro, the __alias macro uses
> macro # stringification to create quotes around
> the section name used in the __attribute__.
>
> Remove the stringification and add quotes or a
> stringification to the uses instead.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>
> There is a script that might eventually be applied
> to convert the __section macro definition and uses
> to remove stringification
>
> https://lore.kernel.org/lkml/46f69161e60b802488ba8c8f3f8bbf922aa3b49b.camel@perches.com/
> https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/
>
> This patch is intended to create commonality
> between the uses of __section and __alias.
>
>  arch/x86/boot/compressed/string.c       |  6 +++---
>  arch/x86/include/asm/syscall_wrapper.h  |  2 +-
>  drivers/firmware/efi/runtime-wrappers.c |  2 +-
>  include/linux/compiler_attributes.h     |  2 +-
>  kernel/kcsan/core.c                     | 10 +++++-----
>  lib/crc32.c                             |  4 ++--
>  lib/crypto/aes.c                        |  4 ++--
>  mm/kasan/generic.c                      |  8 ++++----
>  8 files changed, 19 insertions(+), 19 deletions(-)

Reviewed-by: Marco Elver <elver@google.com>

for KCSAN and KASAN.

Thank you!

> diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
> index 81fc1eaa3229..d38b122f51ef 100644
> --- a/arch/x86/boot/compressed/string.c
> +++ b/arch/x86/boot/compressed/string.c
> @@ -75,7 +75,7 @@ void *memcpy(void *dest, const void *src, size_t n)
>  }
>
>  #ifdef CONFIG_KASAN
> -extern void *__memset(void *s, int c, size_t n) __alias(memset);
> -extern void *__memmove(void *dest, const void *src, size_t n) __alias(memmove);
> -extern void *__memcpy(void *dest, const void *src, size_t n) __alias(memcpy);
> +extern void *__memset(void *s, int c, size_t n) __alias("memset");
> +extern void *__memmove(void *dest, const void *src, size_t n) __alias("memmove");
> +extern void *__memcpy(void *dest, const void *src, size_t n) __alias("memcpy");
>  #endif
> diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h
> index a84333adeef2..f19d1bbbff3d 100644
> --- a/arch/x86/include/asm/syscall_wrapper.h
> +++ b/arch/x86/include/asm/syscall_wrapper.h
> @@ -69,7 +69,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs);
>         long __##abi##_##name(const struct pt_regs *regs);              \
>         ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO);                 \
>         long __##abi##_##name(const struct pt_regs *regs)               \
> -               __alias(__do_##name);
> +               __alias("__do_" #name);
>
>  #define __SYS_STUBx(abi, name, ...)                                    \
>         long __##abi##_##name(const struct pt_regs *regs);              \
> diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c
> index 1410beaef5c3..14e380ac65d4 100644
> --- a/drivers/firmware/efi/runtime-wrappers.c
> +++ b/drivers/firmware/efi/runtime-wrappers.c
> @@ -162,7 +162,7 @@ static DEFINE_SEMAPHORE(efi_runtime_lock);
>   * Expose the EFI runtime lock to the UV platform
>   */
>  #ifdef CONFIG_X86_UV
> -extern struct semaphore __efi_uv_runtime_lock __alias(efi_runtime_lock);
> +extern struct semaphore __efi_uv_runtime_lock __alias("efi_runtime_lock");
>  #endif
>
>  /*
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index ea7b756b1c8f..4819512c9abd 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -42,7 +42,7 @@
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
>   */
> -#define __alias(symbol)                 __attribute__((__alias__(#symbol)))
> +#define __alias(symbol)                 __attribute__((__alias__(symbol)))
>
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
> diff --git a/kernel/kcsan/core.c b/kernel/kcsan/core.c
> index 3994a217bde7..465f6cfc317c 100644
> --- a/kernel/kcsan/core.c
> +++ b/kernel/kcsan/core.c
> @@ -814,7 +814,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_read##size);                                      \
>         void __tsan_unaligned_read##size(void *ptr)                            \
> -               __alias(__tsan_read##size);                                    \
> +               __alias("__tsan_read" #size);                                  \
>         EXPORT_SYMBOL(__tsan_unaligned_read##size);                            \
>         void __tsan_write##size(void *ptr);                                    \
>         void __tsan_write##size(void *ptr)                                     \
> @@ -823,7 +823,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_write##size);                                     \
>         void __tsan_unaligned_write##size(void *ptr)                           \
> -               __alias(__tsan_write##size);                                   \
> +               __alias("__tsan_write" #size);                                 \
>         EXPORT_SYMBOL(__tsan_unaligned_write##size);                           \
>         void __tsan_read_write##size(void *ptr);                               \
>         void __tsan_read_write##size(void *ptr)                                \
> @@ -833,7 +833,7 @@ EXPORT_SYMBOL(__kcsan_check_access);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_read_write##size);                                \
>         void __tsan_unaligned_read_write##size(void *ptr)                      \
> -               __alias(__tsan_read_write##size);                              \
> +               __alias("__tsan_read_write" #size);                            \
>         EXPORT_SYMBOL(__tsan_unaligned_read_write##size)
>
>  DEFINE_TSAN_READ_WRITE(1);
> @@ -877,7 +877,7 @@ EXPORT_SYMBOL(__tsan_write_range);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_volatile_read##size);                             \
>         void __tsan_unaligned_volatile_read##size(void *ptr)                   \
> -               __alias(__tsan_volatile_read##size);                           \
> +               __alias("__tsan_volatile_read" #size);                         \
>         EXPORT_SYMBOL(__tsan_unaligned_volatile_read##size);                   \
>         void __tsan_volatile_write##size(void *ptr);                           \
>         void __tsan_volatile_write##size(void *ptr)                            \
> @@ -892,7 +892,7 @@ EXPORT_SYMBOL(__tsan_write_range);
>         }                                                                      \
>         EXPORT_SYMBOL(__tsan_volatile_write##size);                            \
>         void __tsan_unaligned_volatile_write##size(void *ptr)                  \
> -               __alias(__tsan_volatile_write##size);                          \
> +               __alias("__tsan_volatile_write" #size);                        \
>         EXPORT_SYMBOL(__tsan_unaligned_volatile_write##size)
>
>  DEFINE_TSAN_VOLATILE_READ_WRITE(1);
> diff --git a/lib/crc32.c b/lib/crc32.c
> index 2a68dfd3b96c..373a17aaa432 100644
> --- a/lib/crc32.c
> +++ b/lib/crc32.c
> @@ -206,8 +206,8 @@ u32 __pure __weak __crc32c_le(u32 crc, unsigned char const *p, size_t len)
>  EXPORT_SYMBOL(crc32_le);
>  EXPORT_SYMBOL(__crc32c_le);
>
> -u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias(crc32_le);
> -u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias(__crc32c_le);
> +u32 __pure crc32_le_base(u32, unsigned char const *, size_t) __alias("crc32_le");
> +u32 __pure __crc32c_le_base(u32, unsigned char const *, size_t) __alias("__crc32c_le");
>
>  /*
>   * This multiplies the polynomials x and y modulo the given modulus.
> diff --git a/lib/crypto/aes.c b/lib/crypto/aes.c
> index 827fe89922ff..5b80514595c2 100644
> --- a/lib/crypto/aes.c
> +++ b/lib/crypto/aes.c
> @@ -82,8 +82,8 @@ static volatile const u8 __cacheline_aligned aes_inv_sbox[] = {
>         0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
>  };
>
> -extern const u8 crypto_aes_sbox[256] __alias(aes_sbox);
> -extern const u8 crypto_aes_inv_sbox[256] __alias(aes_inv_sbox);
> +extern const u8 crypto_aes_sbox[256] __alias("aes_sbox");
> +extern const u8 crypto_aes_inv_sbox[256] __alias("aes_inv_sbox");
>
>  EXPORT_SYMBOL(crypto_aes_sbox);
>  EXPORT_SYMBOL(crypto_aes_inv_sbox);
> diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
> index 248264b9cb76..4496f897e4f5 100644
> --- a/mm/kasan/generic.c
> +++ b/mm/kasan/generic.c
> @@ -234,7 +234,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
>                 check_memory_region_inline(addr, size, false, _RET_IP_);\
>         }                                                               \
>         EXPORT_SYMBOL(__asan_load##size);                               \
> -       __alias(__asan_load##size)                                      \
> +       __alias("__asan_load" #size)                                    \
>         void __asan_load##size##_noabort(unsigned long);                \
>         EXPORT_SYMBOL(__asan_load##size##_noabort);                     \
>         void __asan_store##size(unsigned long addr)                     \
> @@ -242,7 +242,7 @@ EXPORT_SYMBOL(__asan_unregister_globals);
>                 check_memory_region_inline(addr, size, true, _RET_IP_); \
>         }                                                               \
>         EXPORT_SYMBOL(__asan_store##size);                              \
> -       __alias(__asan_store##size)                                     \
> +       __alias("__asan_store" #size)                                   \
>         void __asan_store##size##_noabort(unsigned long);               \
>         EXPORT_SYMBOL(__asan_store##size##_noabort)
>
> @@ -258,7 +258,7 @@ void __asan_loadN(unsigned long addr, size_t size)
>  }
>  EXPORT_SYMBOL(__asan_loadN);
>
> -__alias(__asan_loadN)
> +__alias("__asan_loadN")
>  void __asan_loadN_noabort(unsigned long, size_t);
>  EXPORT_SYMBOL(__asan_loadN_noabort);
>
> @@ -268,7 +268,7 @@ void __asan_storeN(unsigned long addr, size_t size)
>  }
>  EXPORT_SYMBOL(__asan_storeN);
>
> -__alias(__asan_storeN)
> +__alias("__asan_storeN")
>  void __asan_storeN_noabort(unsigned long, size_t);
>  EXPORT_SYMBOL(__asan_storeN_noabort);
>
>
>
>
>

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 19:07   ` Joe Perches
  2020-10-21 19:09     ` Ard Biesheuvel
@ 2020-10-21 19:23     ` Miguel Ojeda
  2020-10-21 20:23     ` Nick Desaulniers
  2 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2020-10-21 19:23 UTC (permalink / raw)
  To: Joe Perches
  Cc: Ard Biesheuvel, Thomas Gleixner, Borislav Petkov, X86 ML,
	H. Peter Anvin, Marco Elver, Dmitry Vyukov, Herbert Xu,
	David S. Miller, Andrey Ryabinin, Alexander Potapenko,
	Andrew Morton, Nick Desaulniers, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

On Wed, Oct 21, 2020 at 9:07 PM Joe Perches <joe@perches.com> wrote:
>
> Using quotes in __section caused/causes differences
> between clang and gcc.

Yeah, it is a good cleanup get.

Thanks!

> https://lkml.org/lkml/2020/9/29/2187

Can you please put this in a Link: like Ard suggested? (and ideally
find the message in lore.kernel.org instead).

Cheers,
Miguel

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 19:07   ` Joe Perches
  2020-10-21 19:09     ` Ard Biesheuvel
  2020-10-21 19:23     ` Miguel Ojeda
@ 2020-10-21 20:23     ` Nick Desaulniers
  2 siblings, 0 replies; 12+ messages in thread
From: Nick Desaulniers @ 2020-10-21 20:23 UTC (permalink / raw)
  To: Joe Perches
  Cc: Ard Biesheuvel, Thomas Gleixner, Borislav Petkov, X86 ML,
	H. Peter Anvin, Miguel Ojeda, Marco Elver, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

On Wed, Oct 21, 2020 at 12:07 PM Joe Perches <joe@perches.com> wrote:
>
> On Wed, 2020-10-21 at 21:02 +0200, Ard Biesheuvel wrote:
> > On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
> > > Like the __section macro, the __alias macro uses
> > > macro # stringification to create quotes around
> > > the section name used in the __attribute__.
> > >
> > > Remove the stringification and add quotes or a
> > > stringification to the uses instead.
> > >
> >
> > Why?
>
> Using quotes in __section caused/causes differences
> between clang and gcc.
>
> https://lkml.org/lkml/2020/9/29/2187
>
> Using common styles for details like this is good.

Luckily, there's no difference/issue here with alias as there exist
with section: https://godbolt.org/z/eWxc7P
So it's just a stylistic cleanup, not a bugfix.
Acked-by: Nick Desaulniers <ndesaulniers@google.com>

$ grep -rn __attribute__ | grep alias

didn't turn up any other cases that look like they don't use strings.
-- 
Thanks,
~Nick Desaulniers

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

* RE: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 19:02 ` Ard Biesheuvel
  2020-10-21 19:07   ` Joe Perches
@ 2020-10-21 21:18   ` David Laight
  1 sibling, 0 replies; 12+ messages in thread
From: David Laight @ 2020-10-21 21:18 UTC (permalink / raw)
  To: 'Ard Biesheuvel', Joe Perches
  Cc: Thomas Gleixner, Borislav Petkov, X86 ML, H. Peter Anvin,
	Miguel Ojeda, Marco Elver, Dmitry Vyukov, Herbert Xu,
	David S. Miller, Andrey Ryabinin, Alexander Potapenko,
	Andrew Morton, Nick Desaulniers, Linux Kernel Mailing List,
	linux-efi, kasan-dev, Linux Crypto Mailing List, linux-mm

From: Ard Biesheuvel
> Sent: 21 October 2020 20:03
> 
> On Wed, 21 Oct 2020 at 20:58, Joe Perches <joe@perches.com> wrote:
> >
> > Like the __section macro, the __alias macro uses
> > macro # stringification to create quotes around
> > the section name used in the __attribute__.
> >
> > Remove the stringification and add quotes or a
> > stringification to the uses instead.
> >
> 
> Why?

It allows the section name be made up of two concatenated strings.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-21 18:58 [PATCH -next] treewide: Remove stringification from __alias macro definition Joe Perches
  2020-10-21 19:02 ` Ard Biesheuvel
  2020-10-21 19:20 ` Marco Elver
@ 2020-10-22  7:33 ` Peter Zijlstra
  2020-10-22 16:20   ` Joe Perches
  2 siblings, 1 reply; 12+ messages in thread
From: Peter Zijlstra @ 2020-10-22  7:33 UTC (permalink / raw)
  To: Joe Perches
  Cc: Thomas Gleixner, Borislav Petkov, x86, H. Peter Anvin,
	Ard Biesheuvel, Miguel Ojeda, Marco Elver, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers,
	linux-kernel, linux-efi, kasan-dev, linux-crypto, linux-mm

On Wed, Oct 21, 2020 at 11:58:25AM -0700, Joe Perches wrote:
> Like the __section macro, the __alias macro uses
> macro # stringification to create quotes around
> the section name used in the __attribute__.
> 
> Remove the stringification and add quotes or a
> stringification to the uses instead.

There's a complete lack of rationale for this change.

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-22  7:33 ` Peter Zijlstra
@ 2020-10-22 16:20   ` Joe Perches
  2020-11-11  7:19     ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2020-10-22 16:20 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Thomas Gleixner, Borislav Petkov, x86, H. Peter Anvin,
	Ard Biesheuvel, Miguel Ojeda, Marco Elver, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers,
	linux-kernel, linux-efi, kasan-dev, linux-crypto, linux-mm

On Thu, 2020-10-22 at 09:33 +0200, Peter Zijlstra wrote:
> On Wed, Oct 21, 2020 at 11:58:25AM -0700, Joe Perches wrote:
> > Like the __section macro, the __alias macro uses
> > macro # stringification to create quotes around
> > the section name used in the __attribute__.
> > 
> > Remove the stringification and add quotes or a
> > stringification to the uses instead.
> 
> There's a complete lack of rationale for this change.

I'll eventually post V2.
I'm waiting to see if there are more comments.

As I wrote in reply to Ard:

https://lore.kernel.org/lkml/1cecfbfc853b2e71a96ab58661037c28a2f9280e.camel@perches.com/

Using quotes in __section caused/causes differences
between clang and gcc.

https://lkml.org/lkml/2020/9/29/2187

Using common styles for details like this is good.


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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-10-22 16:20   ` Joe Perches
@ 2020-11-11  7:19     ` Ard Biesheuvel
  2020-11-12  9:36       ` Miguel Ojeda
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2020-11-11  7:19 UTC (permalink / raw)
  To: Joe Perches, Russell King
  Cc: Peter Zijlstra, Thomas Gleixner, Borislav Petkov, X86 ML,
	H. Peter Anvin, Miguel Ojeda, Marco Elver, Dmitry Vyukov,
	Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers,
	Linux Kernel Mailing List, linux-efi, kasan-dev,
	Linux Crypto Mailing List, linux-mm

(+ Russell)

On Thu, 22 Oct 2020 at 18:20, Joe Perches <joe@perches.com> wrote:
>
> On Thu, 2020-10-22 at 09:33 +0200, Peter Zijlstra wrote:
> > On Wed, Oct 21, 2020 at 11:58:25AM -0700, Joe Perches wrote:
> > > Like the __section macro, the __alias macro uses
> > > macro # stringification to create quotes around
> > > the section name used in the __attribute__.
> > >
> > > Remove the stringification and add quotes or a
> > > stringification to the uses instead.
> >
> > There's a complete lack of rationale for this change.
>
> I'll eventually post V2.
> I'm waiting to see if there are more comments.
>
> As I wrote in reply to Ard:
>
> https://lore.kernel.org/lkml/1cecfbfc853b2e71a96ab58661037c28a2f9280e.camel@perches.com/
>
> Using quotes in __section caused/causes differences
> between clang and gcc.
>
> https://lkml.org/lkml/2020/9/29/2187
>
> Using common styles for details like this is good.
>

This patch is now causing problems in the ARM tree, because some new
uses of __alias() have been queued (for KASAN), and since this is a
non-backwards compatible change, we have to choose between breaking
the maintainer's tree or breaking -next (given that the change has
been pulled in there now)

I am still not convinced we need this change, as I don't see how the
concerns regarding __section apply to __alias. But if we do, can we
please use the same approach, i.e., revert the current patch, and
queue it again after v5.11-rc1 with all new occurrences covered as
well?

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

* Re: [PATCH -next] treewide: Remove stringification from __alias macro definition
  2020-11-11  7:19     ` Ard Biesheuvel
@ 2020-11-12  9:36       ` Miguel Ojeda
  0 siblings, 0 replies; 12+ messages in thread
From: Miguel Ojeda @ 2020-11-12  9:36 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Joe Perches, Russell King, Peter Zijlstra, Thomas Gleixner,
	Borislav Petkov, X86 ML, H. Peter Anvin, Marco Elver,
	Dmitry Vyukov, Herbert Xu, David S. Miller, Andrey Ryabinin,
	Alexander Potapenko, Andrew Morton, Nick Desaulniers,
	Linux Kernel Mailing List, linux-efi, kasan-dev,
	Linux Crypto Mailing List, linux-mm

On Wed, Nov 11, 2020 at 8:19 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> I am still not convinced we need this change, as I don't see how the
> concerns regarding __section apply to __alias. But if we do, can we
> please use the same approach, i.e., revert the current patch, and
> queue it again after v5.11-rc1 with all new occurrences covered as
> well?

In general, it would be nice to move all compiler attributes to use
the `__` syntax, which is independent of compiler vendor, gives us a
level of indirection to modify behavior between compilers and is
shorter/nicer for users.

But it is low priority, so it should go in whenever it causes the
least amount of trouble.

Cheers,
Miguel

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

end of thread, other threads:[~2020-11-12  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 18:58 [PATCH -next] treewide: Remove stringification from __alias macro definition Joe Perches
2020-10-21 19:02 ` Ard Biesheuvel
2020-10-21 19:07   ` Joe Perches
2020-10-21 19:09     ` Ard Biesheuvel
2020-10-21 19:23     ` Miguel Ojeda
2020-10-21 20:23     ` Nick Desaulniers
2020-10-21 21:18   ` David Laight
2020-10-21 19:20 ` Marco Elver
2020-10-22  7:33 ` Peter Zijlstra
2020-10-22 16:20   ` Joe Perches
2020-11-11  7:19     ` Ard Biesheuvel
2020-11-12  9:36       ` Miguel Ojeda

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).