summaryrefslogtreecommitdiffstats
path: root/kernel/extable.c
diff options
context:
space:
mode:
authorSantosh Sivaraj <santosh@fossix.org>2019-08-20 13:43:49 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2019-08-21 22:23:48 +1000
commit49ec9177b8ec9c081850744468811e708a7c9841 (patch)
tree767d77f89b9faff60a9e8c965a3ec8d95061a86c /kernel/extable.c
parent1a1715f516fd7fcfedffee5978ec4c07c5164470 (diff)
downloadlinux-49ec9177b8ec9c081850744468811e708a7c9841.tar.bz2
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: Santosh Sivaraj <santosh@fossix.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190820081352.8641-5-santosh@fossix.org
Diffstat (limited to 'kernel/extable.c')
-rw-r--r--kernel/extable.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/extable.c b/kernel/extable.c
index e23cce6e6092..f6c9406eec7d 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -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. */
const struct exception_table_entry *search_exception_tables(unsigned long addr)
{
const struct exception_table_entry *e;
- e = search_extable(__start___ex_table,
- __stop___ex_table - __start___ex_table, addr);
+ e = search_kernel_exception_table(addr);
if (!e)
e = search_module_extables(addr);
return e;