Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5368566pxu; Wed, 21 Oct 2020 23:39:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGkuddK59SMNkXun5bZvenTiNN9OeBtPtxocFG6ecx9b7sgmKAezqSecDWvoEWHFIlIQhq X-Received: by 2002:aa7:c256:: with SMTP id y22mr924640edo.108.1603348791988; Wed, 21 Oct 2020 23:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603348791; cv=none; d=google.com; s=arc-20160816; b=C+KTqKz3LiJQiSoGquynF8bZtS1cvKnB9/LxM6KMPCg0v/c4kJH4zFlMmxK9ZedPnh AdYTaxIz3qjmSw03bPqZPVGEtY1HQeflh5ZGQB6NLJlvWY1GsUuORaBoIaEA0dRc94sv Ep/BRm7YCx2u3hXvExyX9xIo3Dde4Ywu+MVNxP07C3/+CpIj6/LObsjFPmRY8uZ3m83m uMTy3TysYkmZjjGhaB3ypai+YHZRXKnLnXBLdaccR52CINmrgRtQjXa1VQxAvLU2Knw0 VJGd9t2tmsZmPjpU7OfVQLehxmMHmya2fAWl/GFgZtsEHtFAryiNPWVGynldnmx7a9y4 AbIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=akqU1MhDkrT7oithdF82for+lErNOGYxs0P90JR1g3w=; b=e9s1qXT6x/uhAgSc4KdSQRAAObkRBVGUkVojAeMWcSlz45HfYuDvcshurNDYIvp6lh 65Tvvq4Wi+pKnsy374QeFd4dA53BfUfRWpn3RFCY8IikzqKnUHdg41xmfllnhizSc6BQ I5To41gANZ7ADe0diKZ5mONrc1yEq9OgDJJ/bhWsz5R8Ey0SY35DSMT/5UH9VuiqnulA f3Hu7rKymUaZOLghcsdth//OzEtanVR4PYkOrx1UqggP3hXoLy/RBthDMndZbyJlTCjw Pnl3XAOXyu6+CHKXaMDszoxemK8HEoAhE2ygCdBTCsrL3mweZrSEqRHlayhf2Ks9815V jZhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VCKexwNU; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si308945ejv.266.2020.10.21.23.39.28; Wed, 21 Oct 2020 23:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VCKexwNU; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441837AbgJUTU4 (ORCPT + 99 others); Wed, 21 Oct 2020 15:20:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437315AbgJUTU4 (ORCPT ); Wed, 21 Oct 2020 15:20:56 -0400 Received: from mail-oo1-xc44.google.com (mail-oo1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBE86C0613CE for ; Wed, 21 Oct 2020 12:20:55 -0700 (PDT) Received: by mail-oo1-xc44.google.com with SMTP id l18so807076ooa.9 for ; Wed, 21 Oct 2020 12:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=akqU1MhDkrT7oithdF82for+lErNOGYxs0P90JR1g3w=; b=VCKexwNUnnzXS/Rf8A+074xlup/dCXAnszpZsKM2ngPoq7J3t0UQFMQ/Sih2QN0G05 82vpKjB7XqsKFy5+h639Xozfne2Ua6mC8xBNHOGs2MDITg+JZdj5JahhSMh4tGqyYtS3 TBn9mPbVvHdmOCgmk+dciG3n14wwEcB+3s9nmj8l+lQp+NVHJ8kh8T0JcMr9VyJRc+AK 1EBNFh/W3oW0HK3RbwvTx8T8dS6eujERtqFMzoNd6YGr2YJYvzLkFeWB8ns7FuSQGlp2 isPer7W0a2y/8NdneMJVyn47bNNm/COWwxMA30gjHXV3fwhMV+KhCQ+ukqkvrR2OP5CZ TcPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=akqU1MhDkrT7oithdF82for+lErNOGYxs0P90JR1g3w=; b=td5xmaYUgZ++bJwTQJDgEM1qe8kNoUe0lcRxvc5pHjBmxh+NouvHWQIeYGapve800W yqAaQTBZclXl2/xZhy95cj9Fc5ayzm+QnC/3yE94u2VWg/mzZ4zMe0wNiDIbtgMHSWzV RO/d7/+PuLY/LPDwp4hOfa2nTVo7RtxFEJ0+VgPUyFkPoJUvMQyHHXhIJeYe2uIwAhuD WDE1E5NubNBMvVhjndYDgOks+9XBKvr43DygDMH3aEB5lq/fndW9lx6Ob9OLk0R3P2wn n3dgbYm9kz1jIqLWUCONweDPtbwOrKIfs9JZAJBGNjfy9eTmz7f6T5xaieAu3SBnOFge z3yA== X-Gm-Message-State: AOAM5311ETjR7WwHDz9qMOEp+zNwGU0W/zc0hF99zjyNW94Uq/4Nicp4 hJsl04TwVg7aqFGnR1dEpljVrzQbR6T0qewJTrLDRQ== X-Received: by 2002:a4a:751a:: with SMTP id j26mr3679810ooc.14.1603308054842; Wed, 21 Oct 2020 12:20:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Marco Elver Date: Wed, 21 Oct 2020 21:20:43 +0200 Message-ID: Subject: Re: [PATCH -next] treewide: Remove stringification from __alias macro definition 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@vger.kernel.org, kasan-dev , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , linux-mm , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 21 Oct 2020 at 20:58, 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. > > Signed-off-by: Joe Perches > --- > > 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 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); > > > > >