From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCAE0C61DD8 for ; Fri, 30 Oct 2020 07:40:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0790822203 for ; Fri, 30 Oct 2020 07:40:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vRO2afTP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0790822203 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 01BD86B005C; Fri, 30 Oct 2020 03:40:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0DA36B005D; Fri, 30 Oct 2020 03:40:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD5D86B0062; Fri, 30 Oct 2020 03:40:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id B19086B005C for ; Fri, 30 Oct 2020 03:40:43 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4C36C181AEF15 for ; Fri, 30 Oct 2020 07:40:43 +0000 (UTC) X-FDA: 77427794766.17.hands89_3a1684f27294 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 29D41180D0180 for ; Fri, 30 Oct 2020 07:40:43 +0000 (UTC) X-HE-Tag: hands89_3a1684f27294 X-Filterd-Recvd-Size: 14033 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 30 Oct 2020 07:40:42 +0000 (UTC) Received: by mail-il1-f195.google.com with SMTP id v18so5733660ilg.1 for ; Fri, 30 Oct 2020 00:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4ZZqckq9iBzbPT7QTQmdrh5Ofh971dIkKFYUcVvnOi0=; b=vRO2afTP9xmkLrr3hNa8kNY68y/KSMurW2vz5nS9SUnAXwCOlia7Xzivl4msbutPp1 zKDKvIKa3szrEgA2/QsE9sTy+v1rjIYhgsgzl3mRTLag8Fqkey+pOTBniRo/1kDqyid6 +ktFIEGbGgNv4lPp6z3OJ4AShoPGnNiOQ5HevhBkIe0BEvhCnkwWc9nEj0TcrwAk/kME 6LXZnUa8OfATEey9e4roUc/C0mdCXVSRH70h0LVmivFPjMpv+9J4DM20HyBdKDWXSPId cSYfcn3ucAeHw0nGOiRaSJTCLIUoxgQThGKM/GAD2TEkvv2aQl3/xeB4bdj0c48i5c14 gsmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4ZZqckq9iBzbPT7QTQmdrh5Ofh971dIkKFYUcVvnOi0=; b=jBj/ipsGCivbICwhEypEK5sNjavdEKbsTNidARY0VY1Bv5UDAvxJayK+0jFVfbODOk Zj/QARav0v64rcyhFb3fWlbG/hDqzfrwgkpO31qgdR1XrTR4uvdcWDnFQ9+cFZmE4El8 +R/6Gv1Uci2+eP2JxasHfo+BnwTP9bNwo+qRBCGxzT4xuS17xOXw08vsmOM9YmqpbJzn ZwuMQZ8rCLd46vyqtTNNoglJSF5+hAs3xWESb/n7l7ilJRFYR2ZPg7N9/Zj3eh8auGfZ 9vw6EXqDeGOBhtRDOv93RSlB8IBKPKhF2YS7alg5raoS60OlpAYoWvhUP6vbHdx1WmV1 Etqw== X-Gm-Message-State: AOAM530oqKaSaacE6tO1rSwa1w0JDkzYNMFltiYU2vhgufj7inb51rXF Ny3UmC8DhDzByZ1fRKpR3lQ= X-Google-Smtp-Source: ABdhPJw4nTcSjrU3sa5Yo0joP9sLNG63ac91gZaWxmMbYZ5HM5zOi2XWBEClUB6t/k21OVJpZwQYXw== X-Received: by 2002:a92:da92:: with SMTP id u18mr975106iln.266.1604043641932; Fri, 30 Oct 2020 00:40:41 -0700 (PDT) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id r3sm4188815iog.55.2020.10.30.00.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 00:40:41 -0700 (PDT) Date: Fri, 30 Oct 2020 00:40:38 -0700 From: Nathan Chancellor To: Joe Perches Cc: Linus Torvalds , Ard Biesheuvel , Miguel Ojeda , Marco Elver , Dmitry Vyukov , Herbert Xu , "David S. Miller" , Andrey Ryabinin , Alexander Potapenko , Nick Desaulniers , 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: Re: [PATCH] treewide: Remove stringification from __alias macro definition Message-ID: <20201030074038.GA1747580@ubuntu-m3-large-x86> References: <8451df41359b52f048780d19e07b6fa4445b6392.1604026698.git.joe@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8451df41359b52f048780d19e07b6fa4445b6392.1604026698.git.joe@perches.com> 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: On Thu, Oct 29, 2020 at 08:07:31PM -0700, Joe Perches wrote: > 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); > > -- > 2.26.0 >