提交 80a3e394 编写于 作者: A Andi Kleen 提交者: Thomas Gleixner

x86/extable: Mark exception handler functions visible

Mark the C exception handler functions that are directly called through
exception tables visible. LTO needs to know they are accessed from assembler.

[ tglx: Mopped up the wrecked argument alignment. Sigh.... ]
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20171222001821.2157-6-andi@firstfloor.org
上级 7cf1aaa2
...@@ -21,7 +21,7 @@ ex_fixup_handler(const struct exception_table_entry *x) ...@@ -21,7 +21,7 @@ ex_fixup_handler(const struct exception_table_entry *x)
return (ex_handler_t)((unsigned long)&x->handler + x->handler); return (ex_handler_t)((unsigned long)&x->handler + x->handler);
} }
bool ex_handler_default(const struct exception_table_entry *fixup, __visible bool ex_handler_default(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
regs->ip = ex_fixup_addr(fixup); regs->ip = ex_fixup_addr(fixup);
...@@ -29,7 +29,7 @@ bool ex_handler_default(const struct exception_table_entry *fixup, ...@@ -29,7 +29,7 @@ bool ex_handler_default(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL(ex_handler_default); EXPORT_SYMBOL(ex_handler_default);
bool ex_handler_fault(const struct exception_table_entry *fixup, __visible bool ex_handler_fault(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
regs->ip = ex_fixup_addr(fixup); regs->ip = ex_fixup_addr(fixup);
...@@ -42,7 +42,7 @@ EXPORT_SYMBOL_GPL(ex_handler_fault); ...@@ -42,7 +42,7 @@ EXPORT_SYMBOL_GPL(ex_handler_fault);
* Handler for UD0 exception following a failed test against the * Handler for UD0 exception following a failed test against the
* result of a refcount inc/dec/add/sub. * result of a refcount inc/dec/add/sub.
*/ */
bool ex_handler_refcount(const struct exception_table_entry *fixup, __visible bool ex_handler_refcount(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
/* First unconditionally saturate the refcount. */ /* First unconditionally saturate the refcount. */
...@@ -95,7 +95,7 @@ EXPORT_SYMBOL(ex_handler_refcount); ...@@ -95,7 +95,7 @@ EXPORT_SYMBOL(ex_handler_refcount);
* of vulnerability by restoring from the initial state (essentially, zeroing * of vulnerability by restoring from the initial state (essentially, zeroing
* out all the FPU registers) if we can't restore from the task's FPU state. * out all the FPU registers) if we can't restore from the task's FPU state.
*/ */
bool ex_handler_fprestore(const struct exception_table_entry *fixup, __visible bool ex_handler_fprestore(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
regs->ip = ex_fixup_addr(fixup); regs->ip = ex_fixup_addr(fixup);
...@@ -108,7 +108,7 @@ bool ex_handler_fprestore(const struct exception_table_entry *fixup, ...@@ -108,7 +108,7 @@ bool ex_handler_fprestore(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL_GPL(ex_handler_fprestore); EXPORT_SYMBOL_GPL(ex_handler_fprestore);
bool ex_handler_ext(const struct exception_table_entry *fixup, __visible bool ex_handler_ext(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
/* Special hack for uaccess_err */ /* Special hack for uaccess_err */
...@@ -118,7 +118,7 @@ bool ex_handler_ext(const struct exception_table_entry *fixup, ...@@ -118,7 +118,7 @@ bool ex_handler_ext(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL(ex_handler_ext); EXPORT_SYMBOL(ex_handler_ext);
bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup, __visible bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
if (pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pF)\n", if (pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pF)\n",
...@@ -133,7 +133,7 @@ bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup, ...@@ -133,7 +133,7 @@ bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL(ex_handler_rdmsr_unsafe); EXPORT_SYMBOL(ex_handler_rdmsr_unsafe);
bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup, __visible bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
if (pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pF)\n", if (pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pF)\n",
...@@ -147,7 +147,7 @@ bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup, ...@@ -147,7 +147,7 @@ bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL(ex_handler_wrmsr_unsafe); EXPORT_SYMBOL(ex_handler_wrmsr_unsafe);
bool ex_handler_clear_fs(const struct exception_table_entry *fixup, __visible bool ex_handler_clear_fs(const struct exception_table_entry *fixup,
struct pt_regs *regs, int trapnr) struct pt_regs *regs, int trapnr)
{ {
if (static_cpu_has(X86_BUG_NULL_SEG)) if (static_cpu_has(X86_BUG_NULL_SEG))
...@@ -157,7 +157,7 @@ bool ex_handler_clear_fs(const struct exception_table_entry *fixup, ...@@ -157,7 +157,7 @@ bool ex_handler_clear_fs(const struct exception_table_entry *fixup,
} }
EXPORT_SYMBOL(ex_handler_clear_fs); EXPORT_SYMBOL(ex_handler_clear_fs);
bool ex_has_fault_handler(unsigned long ip) __visible bool ex_has_fault_handler(unsigned long ip)
{ {
const struct exception_table_entry *e; const struct exception_table_entry *e;
ex_handler_t handler; ex_handler_t handler;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册