x86/traps: Enable all exception handler callbacks early
Now that early_fixup_exception() has pt_regs, we can just call fixup_exception() from it. This will make fancy exception handlers work early. Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Borislav Petkov <bp@alien8.de> Cc: KVM list <kvm@vger.kernel.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: xen-devel <Xen-devel@lists.xen.org> Link: http://lkml.kernel.org/r/20fc047d926150cb08cb9b9f2923519b07ec1a15.1459605520.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
0e861fbb5b
commit
ae7ef45e12
|
@ -88,10 +88,6 @@ extern unsigned int early_recursion_flag;
|
||||||
/* Restricted version used during very early boot */
|
/* Restricted version used during very early boot */
|
||||||
void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
|
void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
|
||||||
{
|
{
|
||||||
const struct exception_table_entry *e;
|
|
||||||
unsigned long new_ip;
|
|
||||||
ex_handler_t handler;
|
|
||||||
|
|
||||||
/* Ignore early NMIs. */
|
/* Ignore early NMIs. */
|
||||||
if (trapnr == X86_TRAP_NMI)
|
if (trapnr == X86_TRAP_NMI)
|
||||||
return;
|
return;
|
||||||
|
@ -102,18 +98,7 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
|
||||||
if (regs->cs != __KERNEL_CS)
|
if (regs->cs != __KERNEL_CS)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
e = search_exception_tables(regs->ip);
|
if (fixup_exception(regs, trapnr))
|
||||||
if (!e)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
new_ip = ex_fixup_addr(e);
|
|
||||||
handler = ex_fixup_handler(e);
|
|
||||||
|
|
||||||
/* special handling not supported during early boot */
|
|
||||||
if (handler != ex_handler_default)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
regs->ip = new_ip;
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
Loading…
Reference in a new issue