Commit 49ec9177 authored by Santosh Sivaraj's avatar Santosh Sivaraj Committed by Michael Ellerman

extable: Add function to search only kernel exception table

Certain architecture specific operating modes (e.g., in powerpc machine
check handler that is unable to access vmalloc memory), the
search_exception_tables cannot be called because it also searches the
module exception tables if entry is not found in the kernel exception
table.
Signed-off-by: default avatarSantosh Sivaraj <santosh@fossix.org>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820081352.8641-5-santosh@fossix.org
parent 1a1715f5
...@@ -19,6 +19,8 @@ void trim_init_extable(struct module *m); ...@@ -19,6 +19,8 @@ void trim_init_extable(struct module *m);
/* Given an address, look for it in the exception tables */ /* Given an address, look for it in the exception tables */
const struct exception_table_entry *search_exception_tables(unsigned long add); const struct exception_table_entry *search_exception_tables(unsigned long add);
const struct exception_table_entry *
search_kernel_exception_table(unsigned long addr);
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
/* For extable.c to search modules' exception tables. */ /* For extable.c to search modules' exception tables. */
......
...@@ -40,13 +40,20 @@ void __init sort_main_extable(void) ...@@ -40,13 +40,20 @@ void __init sort_main_extable(void)
} }
} }
/* Given an address, look for it in the kernel exception table */
const
struct exception_table_entry *search_kernel_exception_table(unsigned long addr)
{
return search_extable(__start___ex_table,
__stop___ex_table - __start___ex_table, addr);
}
/* Given an address, look for it in the exception tables. */ /* Given an address, look for it in the exception tables. */
const struct exception_table_entry *search_exception_tables(unsigned long addr) const struct exception_table_entry *search_exception_tables(unsigned long addr)
{ {
const struct exception_table_entry *e; const struct exception_table_entry *e;
e = search_extable(__start___ex_table, e = search_kernel_exception_table(addr);
__stop___ex_table - __start___ex_table, addr);
if (!e) if (!e)
e = search_module_extables(addr); e = search_module_extables(addr);
return e; return e;
......
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