]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
irq: Make the irqentry text section unconditional
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 3 Aug 2017 02:38:21 +0000 (11:38 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 10 Aug 2017 14:28:53 +0000 (16:28 +0200)
Generate irqentry and softirqentry text sections without
any Kconfig dependencies. This will add extra sections, but
there should be no performace impact.

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: David S . Miller <davem@davemloft.net>
Cc: Francis Deslauriers <francis.deslauriers@efficios.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: linux-arch@vger.kernel.org
Cc: linux-cris-kernel@axis.com
Cc: mathieu.desnoyers@efficios.com
Link: http://lkml.kernel.org/r/150172789110.27216.3955739126693102122.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/arm/include/asm/traps.h
arch/arm64/include/asm/traps.h
arch/x86/entry/entry_64.S
arch/x86/kernel/unwind_frame.c
include/asm-generic/sections.h
include/asm-generic/vmlinux.lds.h
include/linux/interrupt.h

index f555bb3664dcaa2dbee6ab4e1f486d24e360ba8f..683d9230984a51c33a89dac39ae8e7904c7017f9 100644 (file)
@@ -18,7 +18,6 @@ struct undef_hook {
 void register_undef_hook(struct undef_hook *hook);
 void unregister_undef_hook(struct undef_hook *hook);
 
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
 static inline int __in_irqentry_text(unsigned long ptr)
 {
        extern char __irqentry_text_start[];
@@ -27,12 +26,6 @@ static inline int __in_irqentry_text(unsigned long ptr)
        return ptr >= (unsigned long)&__irqentry_text_start &&
               ptr < (unsigned long)&__irqentry_text_end;
 }
-#else
-static inline int __in_irqentry_text(unsigned long ptr)
-{
-       return 0;
-}
-#endif
 
 static inline int in_exception_text(unsigned long ptr)
 {
index 02e9035b0685823faca22e5b6943ba39b7d27ce2..47a9066f7c86f970c5c006d624af590af744d126 100644 (file)
@@ -37,18 +37,11 @@ void unregister_undef_hook(struct undef_hook *hook);
 
 void arm64_notify_segfault(struct pt_regs *regs, unsigned long addr);
 
-#ifdef CONFIG_FUNCTION_GRAPH_TRACER
 static inline int __in_irqentry_text(unsigned long ptr)
 {
        return ptr >= (unsigned long)&__irqentry_text_start &&
               ptr < (unsigned long)&__irqentry_text_end;
 }
-#else
-static inline int __in_irqentry_text(unsigned long ptr)
-{
-       return 0;
-}
-#endif
 
 static inline int in_exception_text(unsigned long ptr)
 {
index d271fb79248f3569c6a0a934f707d91f398562b8..3e3da2928c44072c88fcb561701dc2210ae73f77 100644 (file)
@@ -675,13 +675,8 @@ apicinterrupt3 \num trace(\sym) smp_trace(\sym)
 #endif
 
 /* Make sure APIC interrupt handlers end up in the irqentry section: */
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
-# define PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax"
-# define POP_SECTION_IRQENTRY  .popsection
-#else
-# define PUSH_SECTION_IRQENTRY
-# define POP_SECTION_IRQENTRY
-#endif
+#define PUSH_SECTION_IRQENTRY  .pushsection .irqentry.text, "ax"
+#define POP_SECTION_IRQENTRY   .popsection
 
 .macro apicinterrupt num sym do_sym
 PUSH_SECTION_IRQENTRY
index b9389d72b2f784887e14acc89a6346a78c13c1b4..c29e5bc7e9c910d14eaaab5e99ab725fe00e5cfe 100644 (file)
@@ -91,10 +91,8 @@ static bool in_entry_code(unsigned long ip)
        if (addr >= __entry_text_start && addr < __entry_text_end)
                return true;
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
        if (addr >= __irqentry_text_start && addr < __irqentry_text_end)
                return true;
-#endif
 
        return false;
 }
index 532372c6cf15c8084f4910072e96fd0360bad2cd..e5da44eddd2f3ca7ccaa9f3d78c11eb1775d3b94 100644 (file)
@@ -27,6 +27,8 @@
  *     __kprobes_text_start, __kprobes_text_end
  *     __entry_text_start, __entry_text_end
  *     __ctors_start, __ctors_end
+ *     __irqentry_text_start, __irqentry_text_end
+ *     __softirqentry_text_start, __softirqentry_text_end
  */
 extern char _text[], _stext[], _etext[];
 extern char _data[], _sdata[], _edata[];
@@ -39,6 +41,8 @@ extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
 extern char __kprobes_text_start[], __kprobes_text_end[];
 extern char __entry_text_start[], __entry_text_end[];
 extern char __start_rodata[], __end_rodata[];
+extern char __irqentry_text_start[], __irqentry_text_end[];
+extern char __softirqentry_text_start[], __softirqentry_text_end[];
 
 /* Start and end of .ctors section - used for constructor calls. */
 extern char __ctors_start[], __ctors_end[];
index da0be9a8d1de4c239e53aec01a5e8b9cd87e3bdd..62e2395f0a8239077ce26b33f03ba470e12dbdc6 100644 (file)
                *(.entry.text)                                          \
                VMLINUX_SYMBOL(__entry_text_end) = .;
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
 #define IRQENTRY_TEXT                                                  \
                ALIGN_FUNCTION();                                       \
                VMLINUX_SYMBOL(__irqentry_text_start) = .;              \
                *(.irqentry.text)                                       \
                VMLINUX_SYMBOL(__irqentry_text_end) = .;
-#else
-#define IRQENTRY_TEXT
-#endif
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
 #define SOFTIRQENTRY_TEXT                                              \
                ALIGN_FUNCTION();                                       \
                VMLINUX_SYMBOL(__softirqentry_text_start) = .;          \
                *(.softirqentry.text)                                   \
                VMLINUX_SYMBOL(__softirqentry_text_end) = .;
-#else
-#define SOFTIRQENTRY_TEXT
-#endif
 
 /* Section used for early init (in .S files) */
 #define HEAD_TEXT  *(.head.text)
index a2fddddb0d601ec1e7cc2633643284cfebc7ef9c..59ba11661b6e69988a97e75996239b7ec0dea817 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/atomic.h>
 #include <asm/ptrace.h>
 #include <asm/irq.h>
+#include <asm/sections.h>
 
 /*
  * These correspond to the IORESOURCE_IRQ_* defines in
@@ -726,7 +727,6 @@ extern int early_irq_init(void);
 extern int arch_probe_nr_irqs(void);
 extern int arch_early_irq_init(void);
 
-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
 /*
  * We want to know which function is an entrypoint of a hardirq or a softirq.
  */
@@ -734,16 +734,4 @@ extern int arch_early_irq_init(void);
 #define __softirq_entry  \
        __attribute__((__section__(".softirqentry.text")))
 
-/* Limits of hardirq entrypoints */
-extern char __irqentry_text_start[];
-extern char __irqentry_text_end[];
-/* Limits of softirq entrypoints */
-extern char __softirqentry_text_start[];
-extern char __softirqentry_text_end[];
-
-#else
-#define __irq_entry
-#define __softirq_entry
-#endif
-
 #endif