From patchwork Fri Oct 30 03:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 11868349 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D481139F for ; Fri, 30 Oct 2020 03:07:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A306A20731 for ; Fri, 30 Oct 2020 03:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A306A20731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BC1B86B005C; Thu, 29 Oct 2020 23:07:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B721C6B0062; Thu, 29 Oct 2020 23:07:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A38D46B006C; Thu, 29 Oct 2020 23:07:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id 746336B005C for ; Thu, 29 Oct 2020 23:07:39 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1B3CA181AEF15 for ; Fri, 30 Oct 2020 03:07:39 +0000 (UTC) X-FDA: 77427106638.09.cats85_19012a027292 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 04637180AD80F for ; Fri, 30 Oct 2020 03:07:38 +0000 (UTC) X-Spam-Summary: 1,0,0,ed6a7be94c8b4c85,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:1:2:41:334:355:368:369:379:541:800:960:967:968:973:988:989:1260:1311:1314:1345:1437:1515:1605:1730:1747:1777:1792:1801:1981:2194:2198:2199:2200:2393:2525:2559:2564:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3865:3866:3867:3868:3870:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4052:4250:4321:4419:4605:5007:6119:6261:6691:6737:6742:7903:7904:8603:9025:9149:10004:11026:11232:11473:11657:11658:11914:12043:12048:12296:12297:12438:12555:12895:12986:13894:13972:14394:21080:21433:21451:21627:30029:30054:30089,0,RBL:216.40.44.111:@perches.com:.lbl8.mailshell.net-66.201.201.201 62.8.55.100;04ygy54m3tss1k3hgqn6esjgr4smmopg4mdzi9ii9gb1jm4d4yynr4e6zppxeiu.f7xbp6nhkwyzbd6cdbf6a1c64ymbwxo43hcdd3gz86q3tj89od81ndyzuh8ghoe.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral, Custom_r X-HE-Tag: cats85_19012a027292 X-Filterd-Recvd-Size: 12479 Received: from smtprelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 03:07:38 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id DD427629; Fri, 30 Oct 2020 03:07:37 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:1:2:41:334:355:368:369:379:541:800:960:967:968:973:988:989:1260:1311:1314:1345:1437:1515:1605:1730:1747:1777:1792:1801:1981:2194:2198:2199:2200:2393:2525:2561:2564:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3865:3866:3867:3868:3870:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4052:4250:4321:4419:4605:5007:6119:6261:6691:6737:6742:7903:7904:8603:9025:9149:10004:10848:11026:11232:11473:11657:11658:11914:12043:12048:12296:12297:12438:12555:12895:12986:13894:13972:14394:21080:21433:21451:21627:30029:30054:30089,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: rain79_4f07ec327292 X-Filterd-Recvd-Size: 11188 Received: from joe-laptop.perches.com (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Fri, 30 Oct 2020 03:07:34 +0000 (UTC) From: Joe Perches To: Linus Torvalds , Ard Biesheuvel , Miguel Ojeda , Marco Elver , Dmitry Vyukov , Herbert Xu , "David S. Miller" , Andrey Ryabinin , Alexander Potapenko , Nathan Chancellor , Nick Desaulniers Cc: Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, kasan-dev@googlegroups.com, linux-crypto@vger.kernel.org, linux-mm@kvack.org, clang-built-linux@googlegroups.com Subject: [PATCH] treewide: Remove stringification from __alias macro definition Date: Thu, 29 Oct 2020 20:07:31 -0700 Message-Id: <8451df41359b52f048780d19e07b6fa4445b6392.1604026698.git.joe@perches.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Like the old __section macro, the __alias macro uses macro # stringification to create quotes around the symbol name used in the __attribute__. This can cause differences between gcc and clang when the stringification itself contains a quote character. So avoid these differences by always using quotes to define the aliased symbol. Remove the stringification and add quotes and when necessary a stringification when existing uses have a ## concatenation. Signed-off-by: Joe Perches Reviewed-by: Nathan Chancellor --- Unlike the __section macro conversion in commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo) to __section("foo")") this one was done by hand. No other use of __alias exists in the kernel. This patch does _not_ convert any uses of __attribute__((alias(""))) so it should not cause any compilation issues. 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);