Commit 9fbcc57a authored by Josh Poimboeuf's avatar Josh Poimboeuf Committed by Ingo Molnar

extable: Make init_kernel_text() global

Convert init_kernel_text() to a global function and use it in a few
places instead of manually comparing _sinittext and _einittext.

Note that kallsyms.h has a very similar function called
is_kernel_inittext(), but its end check is inclusive.  I'm not sure
whether that's intentional behavior, so I didn't touch it.
Suggested-by: 's avatarJason Baron <jbaron@akamai.com>
Signed-off-by: 's avatarJosh Poimboeuf <jpoimboe@redhat.com>
Acked-by: 's avatarPeter Zijlstra <peterz@infradead.org>
Acked-by: 's avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/4335d02be8d45ca7d265d2f174251d0b7ee6c5fd.1519051220.git.jpoimboe@redhat.comSigned-off-by: 's avatarIngo Molnar <mingo@kernel.org>
parent dc1dd184
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <asm/unwind.h> #include <asm/unwind.h>
#include <asm/orc_types.h> #include <asm/orc_types.h>
#include <asm/orc_lookup.h> #include <asm/orc_lookup.h>
#include <asm/sections.h>
#define orc_warn(fmt, ...) \ #define orc_warn(fmt, ...) \
printk_deferred_once(KERN_WARNING pr_fmt("WARNING: " fmt), ##__VA_ARGS__) printk_deferred_once(KERN_WARNING pr_fmt("WARNING: " fmt), ##__VA_ARGS__)
...@@ -148,7 +147,7 @@ static struct orc_entry *orc_find(unsigned long ip) ...@@ -148,7 +147,7 @@ static struct orc_entry *orc_find(unsigned long ip)
} }
/* vmlinux .init slow lookup: */ /* vmlinux .init slow lookup: */
if (ip >= (unsigned long)_sinittext && ip < (unsigned long)_einittext) if (init_kernel_text(ip))
return __orc_find(__start_orc_unwind_ip, __start_orc_unwind, return __orc_find(__start_orc_unwind_ip, __start_orc_unwind,
__stop_orc_unwind_ip - __start_orc_unwind_ip, ip); __stop_orc_unwind_ip - __start_orc_unwind_ip, ip);
......
...@@ -472,6 +472,7 @@ extern bool parse_option_str(const char *str, const char *option); ...@@ -472,6 +472,7 @@ extern bool parse_option_str(const char *str, const char *option);
extern char *next_arg(char *args, char **param, char **val); extern char *next_arg(char *args, char **param, char **val);
extern int core_kernel_text(unsigned long addr); extern int core_kernel_text(unsigned long addr);
extern int init_kernel_text(unsigned long addr);
extern int core_kernel_data(unsigned long addr); extern int core_kernel_data(unsigned long addr);
extern int __kernel_text_address(unsigned long addr); extern int __kernel_text_address(unsigned long addr);
extern int kernel_text_address(unsigned long addr); extern int kernel_text_address(unsigned long addr);
......
...@@ -64,7 +64,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) ...@@ -64,7 +64,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
return e; return e;
} }
static inline int init_kernel_text(unsigned long addr) int init_kernel_text(unsigned long addr)
{ {
if (addr >= (unsigned long)_sinittext && if (addr >= (unsigned long)_sinittext &&
addr < (unsigned long)_einittext) addr < (unsigned long)_einittext)
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/jump_label_ratelimit.h> #include <linux/jump_label_ratelimit.h>
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/sections.h>
#ifdef HAVE_JUMP_LABEL #ifdef HAVE_JUMP_LABEL
...@@ -429,8 +428,7 @@ void __init jump_label_invalidate_init(void) ...@@ -429,8 +428,7 @@ void __init jump_label_invalidate_init(void)
struct jump_entry *iter; struct jump_entry *iter;
for (iter = iter_start; iter < iter_stop; iter++) { for (iter = iter_start; iter < iter_stop; iter++) {
if (iter->code >= (unsigned long)_sinittext && if (init_kernel_text(iter->code))
iter->code < (unsigned long)_einittext)
iter->code = 0; iter->code = 0;
} }
} }
......
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