Commit 229a7186 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

irq: Make the irqentry text section unconditional

Generate irqentry and softirqentry text sections without
any Kconfig dependencies. This will add extra sections, but
there should be no performace impact.
Suggested-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarMasami 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@devboxSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent c2579fee
...@@ -18,7 +18,6 @@ struct undef_hook { ...@@ -18,7 +18,6 @@ struct undef_hook {
void register_undef_hook(struct undef_hook *hook); void register_undef_hook(struct undef_hook *hook);
void unregister_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) static inline int __in_irqentry_text(unsigned long ptr)
{ {
extern char __irqentry_text_start[]; extern char __irqentry_text_start[];
...@@ -27,12 +26,6 @@ static inline int __in_irqentry_text(unsigned long ptr) ...@@ -27,12 +26,6 @@ static inline int __in_irqentry_text(unsigned long ptr)
return ptr >= (unsigned long)&__irqentry_text_start && return ptr >= (unsigned long)&__irqentry_text_start &&
ptr < (unsigned long)&__irqentry_text_end; 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) static inline int in_exception_text(unsigned long ptr)
{ {
......
...@@ -37,18 +37,11 @@ void unregister_undef_hook(struct undef_hook *hook); ...@@ -37,18 +37,11 @@ void unregister_undef_hook(struct undef_hook *hook);
void arm64_notify_segfault(struct pt_regs *regs, unsigned long addr); 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) static inline int __in_irqentry_text(unsigned long ptr)
{ {
return ptr >= (unsigned long)&__irqentry_text_start && return ptr >= (unsigned long)&__irqentry_text_start &&
ptr < (unsigned long)&__irqentry_text_end; 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) static inline int in_exception_text(unsigned long ptr)
{ {
......
...@@ -675,13 +675,8 @@ apicinterrupt3 \num trace(\sym) smp_trace(\sym) ...@@ -675,13 +675,8 @@ apicinterrupt3 \num trace(\sym) smp_trace(\sym)
#endif #endif
/* Make sure APIC interrupt handlers end up in the irqentry section: */ /* 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 PUSH_SECTION_IRQENTRY .pushsection .irqentry.text, "ax" #define POP_SECTION_IRQENTRY .popsection
# define POP_SECTION_IRQENTRY .popsection
#else
# define PUSH_SECTION_IRQENTRY
# define POP_SECTION_IRQENTRY
#endif
.macro apicinterrupt num sym do_sym .macro apicinterrupt num sym do_sym
PUSH_SECTION_IRQENTRY PUSH_SECTION_IRQENTRY
......
...@@ -91,10 +91,8 @@ static bool in_entry_code(unsigned long ip) ...@@ -91,10 +91,8 @@ static bool in_entry_code(unsigned long ip)
if (addr >= __entry_text_start && addr < __entry_text_end) if (addr >= __entry_text_start && addr < __entry_text_end)
return true; return true;
#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
if (addr >= __irqentry_text_start && addr < __irqentry_text_end) if (addr >= __irqentry_text_start && addr < __irqentry_text_end)
return true; return true;
#endif
return false; return false;
} }
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
* __kprobes_text_start, __kprobes_text_end * __kprobes_text_start, __kprobes_text_end
* __entry_text_start, __entry_text_end * __entry_text_start, __entry_text_end
* __ctors_start, __ctors_end * __ctors_start, __ctors_end
* __irqentry_text_start, __irqentry_text_end
* __softirqentry_text_start, __softirqentry_text_end
*/ */
extern char _text[], _stext[], _etext[]; extern char _text[], _stext[], _etext[];
extern char _data[], _sdata[], _edata[]; extern char _data[], _sdata[], _edata[];
...@@ -39,6 +41,8 @@ extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; ...@@ -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 __kprobes_text_start[], __kprobes_text_end[];
extern char __entry_text_start[], __entry_text_end[]; extern char __entry_text_start[], __entry_text_end[];
extern char __start_rodata[], __end_rodata[]; 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. */ /* Start and end of .ctors section - used for constructor calls. */
extern char __ctors_start[], __ctors_end[]; extern char __ctors_start[], __ctors_end[];
......
...@@ -483,25 +483,17 @@ ...@@ -483,25 +483,17 @@
*(.entry.text) \ *(.entry.text) \
VMLINUX_SYMBOL(__entry_text_end) = .; VMLINUX_SYMBOL(__entry_text_end) = .;
#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
#define IRQENTRY_TEXT \ #define IRQENTRY_TEXT \
ALIGN_FUNCTION(); \ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__irqentry_text_start) = .; \ VMLINUX_SYMBOL(__irqentry_text_start) = .; \
*(.irqentry.text) \ *(.irqentry.text) \
VMLINUX_SYMBOL(__irqentry_text_end) = .; VMLINUX_SYMBOL(__irqentry_text_end) = .;
#else
#define IRQENTRY_TEXT
#endif
#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
#define SOFTIRQENTRY_TEXT \ #define SOFTIRQENTRY_TEXT \
ALIGN_FUNCTION(); \ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__softirqentry_text_start) = .; \ VMLINUX_SYMBOL(__softirqentry_text_start) = .; \
*(.softirqentry.text) \ *(.softirqentry.text) \
VMLINUX_SYMBOL(__softirqentry_text_end) = .; VMLINUX_SYMBOL(__softirqentry_text_end) = .;
#else
#define SOFTIRQENTRY_TEXT
#endif
/* Section used for early init (in .S files) */ /* Section used for early init (in .S files) */
#define HEAD_TEXT *(.head.text) #define HEAD_TEXT *(.head.text)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sections.h>
/* /*
* These correspond to the IORESOURCE_IRQ_* defines in * These correspond to the IORESOURCE_IRQ_* defines in
...@@ -726,7 +727,6 @@ extern int early_irq_init(void); ...@@ -726,7 +727,6 @@ extern int early_irq_init(void);
extern int arch_probe_nr_irqs(void); extern int arch_probe_nr_irqs(void);
extern int arch_early_irq_init(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. * 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); ...@@ -734,16 +734,4 @@ extern int arch_early_irq_init(void);
#define __softirq_entry \ #define __softirq_entry \
__attribute__((__section__(".softirqentry.text"))) __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 #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment