From patchwork Mon Aug 12 21:50:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 11090935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A791112C for ; Mon, 12 Aug 2019 21:53:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6978928573 for ; Mon, 12 Aug 2019 21:53:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B4212857B; Mon, 12 Aug 2019 21:53:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED3F328573 for ; Mon, 12 Aug 2019 21:53:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbfHLVxE (ORCPT ); Mon, 12 Aug 2019 17:53:04 -0400 Received: from mail-yb1-f201.google.com ([209.85.219.201]:36295 "EHLO mail-yb1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbfHLVxE (ORCPT ); Mon, 12 Aug 2019 17:53:04 -0400 Received: by mail-yb1-f201.google.com with SMTP id f1so79730014ybq.3 for ; Mon, 12 Aug 2019 14:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=BvdjllFJec+jnIcbVyaNPdSiqXqeyTxUF0Oq2y0JBBs=; b=trJf4uh35Q+jM8xrFmCBx5akz0qigqRqbkG0gq6EWNOOLO/cOfUvRg1zYN5Krgv3CZ Tp1oZIRrBLfLcNZzy6SSSUo71Csv7Y3cFXPmmR7rvXmaWdO9mbsawI7DguqmCmrmbVpj OelkWG7IFbyN9AnUs4BQf674u45J6BxNK95owQBiAxsnXJTFtmC3i4b2KMu/kGOCGuWe ZqNuQbhRnOMtQHz25dSaqwt4Ubu+FdRkdDanK3J5max+fpx6beFdYmlXC9cOmr4gj4af p2l+5noMg0PDkQDUNn0/RkENSN49fNvUA25zUQaYBr0wEjs6uYeq7Va+qoI/9WmON+TA 96Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=BvdjllFJec+jnIcbVyaNPdSiqXqeyTxUF0Oq2y0JBBs=; b=FumD3uxLsSM7A/zwkJFb6y7R2tTaoWMr6u+8+2/T9tBGoJ+72kHxetIAhrYrZJEzrA I7veTg6Rwp6PVca6PNDQJl/J3U9R9uLE1QTxShYvS7kYTt/BMf5UglJUvO7VOZQ4u9Cq jA6sUQMgdIQx/d5CXgwIsC0KNaCQEc2oUk6tgPMgipoa6aNV866OWkdyFoX07NjHObED uAUE2QJDBgWq6uO/B+/vsbosj8mIz1/7tcqMvv+nv4vedCaZgk4nmnQF7ZMAVP3zNNpM lSN0xJ55Temu+d+GptbKSOEXhvhFnNkOEOzoLM/eMelpY7zwTk+vmwjTuMAhl8jWBO3l I0GQ== X-Gm-Message-State: APjAAAWiY5YEq66cKj1ex5NwOO/ZwiijIvuyZX4DcLcsUXIteWM8oCg6 DOzZw9JYhXhKc5Sqbo0mN5lr9seH4wcESaQqXoI= X-Google-Smtp-Source: APXvYqzdrNVqqM5QUhyk1i8bOe2OLz5Nx2ebt2vknIaukQDHhNvZesBvUdRvlKbq1TzEAKfk3lldP11tUWbgLH1Fk5Q= X-Received: by 2002:a81:4858:: with SMTP id v85mr13462571ywa.370.1565646782523; Mon, 12 Aug 2019 14:53:02 -0700 (PDT) Date: Mon, 12 Aug 2019 14:50:47 -0700 In-Reply-To: <20190812215052.71840-1-ndesaulniers@google.com> Message-Id: <20190812215052.71840-14-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190812215052.71840-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH 14/16] include/linux: prefer __section from compiler_attributes.h From: Nick Desaulniers To: akpm@linux-foundation.org Cc: sedat.dilek@gmail.com, jpoimboe@redhat.com, yhs@fb.com, miguel.ojeda.sandonis@gmail.com, clang-built-linux@googlegroups.com, Nick Desaulniers , Luc Van Oostenryck , Lai Jiangshan , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Thomas Gleixner , Ingo Molnar , "Peter Zijlstra (Intel)" , Nicholas Piggin , Jiri Kosina , Will Deacon , Ard Biesheuvel , Michael Ellerman , Masahiro Yamada , Hans Liljestrand , Elena Reshetova , David Windsor , Marc Zyngier , Ming Lei , Dou Liyang , Julien Thierry , Mauro Carvalho Chehab , Jens Axboe , linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, rcu@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Link: https://github.com/ClangBuiltLinux/linux/issues/619 Reported-by: Sedat Dilek Suggested-by: Josh Poimboeuf Signed-off-by: Nick Desaulniers Tested-by: Sedat Dilek [ Linux v5.3-rc5 ] --- include/linux/cache.h | 6 +++--- include/linux/compiler.h | 8 ++++---- include/linux/cpu.h | 2 +- include/linux/export.h | 2 +- include/linux/init_task.h | 4 ++-- include/linux/interrupt.h | 5 ++--- include/linux/sched/debug.h | 2 +- include/linux/srcutree.h | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/linux/cache.h b/include/linux/cache.h index 750621e41d1c..3f4df9eef1e1 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h @@ -28,7 +28,7 @@ * but may get written to during init, so can't live in .rodata (via "const"). */ #ifndef __ro_after_init -#define __ro_after_init __attribute__((__section__(".data..ro_after_init"))) +#define __ro_after_init __section(.data..ro_after_init) #endif #ifndef ____cacheline_aligned @@ -45,8 +45,8 @@ #ifndef __cacheline_aligned #define __cacheline_aligned \ - __attribute__((__aligned__(SMP_CACHE_BYTES), \ - __section__(".data..cacheline_aligned"))) + __aligned(SMP_CACHE_BYTES) \ + __section(.data..cacheline_aligned) #endif /* __cacheline_aligned */ #ifndef __cacheline_aligned_in_smp diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f0fd5636fddb..5e88e7e33abe 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, long ______r; \ static struct ftrace_likely_data \ __aligned(4) \ - __section("_ftrace_annotated_branch") \ + __section(_ftrace_annotated_branch) \ ______f = { \ .data.func = __func__, \ .data.file = __FILE__, \ @@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, #define __trace_if_value(cond) ({ \ static struct ftrace_branch_data \ __aligned(4) \ - __section("_ftrace_branch") \ + __section(_ftrace_branch) \ __if_trace = { \ .func = __func__, \ .file = __FILE__, \ @@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, ".popsection\n\t" /* Annotate a C jump table to allow objtool to follow the code flow */ -#define __annotate_jump_table __section(".rodata..c_jump_table") +#define __annotate_jump_table __section(.rodata..c_jump_table) #else #define annotate_reachable() @@ -298,7 +298,7 @@ unsigned long read_word_at_a_time(const void *addr) * visible to the compiler. */ #define __ADDRESSABLE(sym) \ - static void * __section(".discard.addressable") __used \ + static void * __section(.discard.addressable) __used \ __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; /** diff --git a/include/linux/cpu.h b/include/linux/cpu.h index fcb1386bb0d4..186bbd79d6ce 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -166,7 +166,7 @@ void cpu_startup_entry(enum cpuhp_state state); void cpu_idle_poll_ctrl(bool enable); /* Attach to any functions which should be considered cpuidle. */ -#define __cpuidle __attribute__((__section__(".cpuidle.text"))) +#define __cpuidle __section(.cpuidle.text) bool cpu_in_idle(unsigned long pc); diff --git a/include/linux/export.h b/include/linux/export.h index fd8711ed9ac4..808c1a0c2ef9 100644 --- a/include/linux/export.h +++ b/include/linux/export.h @@ -104,7 +104,7 @@ struct kernel_symbol { * discarded in the final link stage. */ #define __ksym_marker(sym) \ - static int __ksym_marker_##sym[0] __section(".discard.ksym") __used + static int __ksym_marker_##sym[0] __section(.discard.ksym) __used #define __EXPORT_SYMBOL(sym, sec) \ __ksym_marker(sym); \ diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 6049baa5b8bc..50139505da34 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -51,12 +51,12 @@ extern struct cred init_cred; /* Attach to the init_task data structure for proper alignment */ #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK -#define __init_task_data __attribute__((__section__(".data..init_task"))) +#define __init_task_data __section(.data..init_task) #else #define __init_task_data /**/ #endif /* Attach to the thread_info data structure for proper alignment */ -#define __init_thread_info __attribute__((__section__(".data..init_thread_info"))) +#define __init_thread_info __section(.data..init_thread_info) #endif diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 5b8328a99b2a..29debfe4dd0f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -741,8 +741,7 @@ extern int arch_early_irq_init(void); /* * We want to know which function is an entrypoint of a hardirq or a softirq. */ -#define __irq_entry __attribute__((__section__(".irqentry.text"))) -#define __softirq_entry \ - __attribute__((__section__(".softirqentry.text"))) +#define __irq_entry __section(.irqentry.text) +#define __softirq_entry __section(.softirqentry.text) #endif diff --git a/include/linux/sched/debug.h b/include/linux/sched/debug.h index 95fb9e025247..e17b66221fdd 100644 --- a/include/linux/sched/debug.h +++ b/include/linux/sched/debug.h @@ -42,7 +42,7 @@ extern void proc_sched_set_task(struct task_struct *p); #endif /* Attach to any functions which should be ignored in wchan output. */ -#define __sched __attribute__((__section__(".sched.text"))) +#define __sched __section(.sched.text) /* Linker adds these: start and end of __sched functions */ extern char __sched_text_start[], __sched_text_end[]; diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h index 9cfcc8a756ae..9de652f4e1bd 100644 --- a/include/linux/srcutree.h +++ b/include/linux/srcutree.h @@ -124,7 +124,7 @@ struct srcu_struct { # define __DEFINE_SRCU(name, is_static) \ is_static struct srcu_struct name; \ struct srcu_struct * const __srcu_struct_##name \ - __section("___srcu_struct_ptrs") = &name + __section(___srcu_struct_ptrs) = &name #else # define __DEFINE_SRCU(name, is_static) \ static DEFINE_PER_CPU(struct srcu_data, name##_srcu_data); \ From patchwork Mon Aug 12 21:50:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 11090933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90C19112C for ; Mon, 12 Aug 2019 21:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F5CF28573 for ; Mon, 12 Aug 2019 21:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F1982857B; Mon, 12 Aug 2019 21:53:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3CA328573 for ; Mon, 12 Aug 2019 21:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728021AbfHLVxN (ORCPT ); Mon, 12 Aug 2019 17:53:13 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:54145 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727880AbfHLVxH (ORCPT ); Mon, 12 Aug 2019 17:53:07 -0400 Received: by mail-pf1-f202.google.com with SMTP id 191so67074580pfy.20 for ; Mon, 12 Aug 2019 14:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=mebfbjlkEdZmmfTa81qyikO5W5onC7JtmBJnlT+apBs=; b=F7+jqw49SQZDkzeeWOAGmc6Lc1h+SEKaJh0xlc/LAxLKe2v+de+46qMQvwT+4BkWvs f8AKwNOC2CnnRVjmawfvPbXbdhxoRH91LyrcooNmXAxHmZ/SSIiRp7NP7qehBJkD9Olp Ggic8vteYilEaiqd7MDETwi5wJ0mukkru6pKC350sgRkfmYpmA1Uf6c4JGCBq+4KCoFj Zcd1QsAZD6fs0YID/HD9qvUSEmxUnQVeQOHFtt9VRuQrg3TjVMVYz9ZZaP6BYPbc4TbJ UrL5f27WPHBtcOEV1KHCFIthMyxdDU2shC6ubPAwjtByDHIVqz1vzmt1fTLro53yIjGq fxXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=mebfbjlkEdZmmfTa81qyikO5W5onC7JtmBJnlT+apBs=; b=Gs+5cja5ke9xMwQHw6j2LUjGjpDDmRNtxCj3Zkt7J00pj7sKpr1eAkT0O40leMryAc bZkCbv6jOlyyM2zaVa2bbJxJXWydf/AwBAc07FwY0KXYYgjkarHOKGfwG7wHqUULF6m/ g0CoFqAn5Zk7hRe6cE0vAOqBrCDgoilRrrKNVBrtRstvHnd5SQIL1Otpjlf9s+/Vg3B8 rVkqgUoRIlCOpLQtGt+p8uUVzPBYEuTGjhutyVP9Z937Ya38afS86m3MPpE0QXoalAcj PW3vz7poWfmmTzyWaLr5RFaPy4SXVeMxEgKCuQJPSXN93AJhJeJACgjN9S4cqO7xtR2T NyIA== X-Gm-Message-State: APjAAAV70YwsJJFbtLkZViWCT1ir9oPHE505awAw3G37zZ8VK9hYJeGc j3Io7W3TcQURBR30EaYrUjTbWrAs682VRlzIqD8= X-Google-Smtp-Source: APXvYqzq0U1hjY8eWG6GSRKegcIlvhtHVnc6vSGEgTKw2aQOoeh9n5S0ZRoCoSIobu8VYEPAe+LSTHysytF0nT5E2UM= X-Received: by 2002:a63:4461:: with SMTP id t33mr31217445pgk.124.1565646786608; Mon, 12 Aug 2019 14:53:06 -0700 (PDT) Date: Mon, 12 Aug 2019 14:50:48 -0700 In-Reply-To: <20190812215052.71840-1-ndesaulniers@google.com> Message-Id: <20190812215052.71840-15-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190812215052.71840-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.23.0.rc1.153.gdeed80330f-goog Subject: [PATCH 15/16] include/linux/compiler.h: remove unused KENTRY macro From: Nick Desaulniers To: akpm@linux-foundation.org Cc: sedat.dilek@gmail.com, jpoimboe@redhat.com, yhs@fb.com, miguel.ojeda.sandonis@gmail.com, clang-built-linux@googlegroups.com, Nick Desaulniers , Luc Van Oostenryck , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This macro is not used throughout the kernel. Delete it rather than update the __section to be a fully spelled out __attribute__((__section__())) to avoid https://bugs.llvm.org/show_bug.cgi?id=42950. Signed-off-by: Nick Desaulniers Tested-by: Sedat Dilek [ Linux v5.3-rc5 ] --- include/linux/compiler.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5e88e7e33abe..f01c1e527f85 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -136,29 +136,6 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, } while (0) #endif -/* - * KENTRY - kernel entry point - * This can be used to annotate symbols (functions or data) that are used - * without their linker symbol being referenced explicitly. For example, - * interrupt vector handlers, or functions in the kernel image that are found - * programatically. - * - * Not required for symbols exported with EXPORT_SYMBOL, or initcalls. Those - * are handled in their own way (with KEEP() in linker scripts). - * - * KENTRY can be avoided if the symbols in question are marked as KEEP() in the - * linker script. For example an architecture could KEEP() its entire - * boot/exception vector code rather than annotate each function and data. - */ -#ifndef KENTRY -# define KENTRY(sym) \ - extern typeof(sym) sym; \ - static const unsigned long __kentry_##sym \ - __used \ - __section("___kentry" "+" #sym ) \ - = (unsigned long)&sym; -#endif - #ifndef RELOC_HIDE # define RELOC_HIDE(ptr, off) \ ({ unsigned long __ptr; \