Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1369948

[PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early
Date 2016-04-02 16:10 +0200
Message-ID <rjups-4TG-3@gated-at.bofh.it> (permalink)
References <rjups-4TG-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Now that early_fixup_exception has pt_regs, we can just call
fixup_exception from it.  This will make fancy exception handlers
work early.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/mm/extable.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 8997022abebc..50dfe438bd91 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -95,10 +95,6 @@ extern unsigned int early_recursion_flag;
 /* Restricted version used during very early boot */
 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. */
 	if (trapnr == X86_TRAP_NMI)
 		return;
@@ -109,19 +105,8 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
 	if (regs->cs != __KERNEL_CS)
 		goto fail;
 
-	e = search_exception_tables(regs->ip);
-	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;
+	if (fixup_exception(regs, trapnr))
+		return;
 
 fail:
 	early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n",
-- 
2.5.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Andy Lutomirski <luto@kernel.org> - 2016-04-02 16:10 +0200
  Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks  early Borislav Petkov <bp@alien8.de> - 2016-04-02 21:00 +0200
    Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Andy Lutomirski <luto@amacapital.net> - 2016-04-02 22:20 +0200
      Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks  early Borislav Petkov <bp@alien8.de> - 2016-04-02 23:00 +0200
        Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks  early Borislav Petkov <bp@alien8.de> - 2016-04-03 10:10 +0200
          Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Andy Lutomirski <luto@amacapital.net> - 2016-04-03 15:30 +0200
          Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-03 16:00 +0200
            Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Andy Lutomirski <luto@amacapital.net> - 2016-04-03 16:00 +0200
              Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Linus Torvalds <torvalds@linux-foundation.org> - 2016-04-03 16:20 +0200
              Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks  early Borislav Petkov <bp@alien8.de> - 2016-04-03 16:20 +0200
                Re: [PATCH v5 4/9] x86/traps: Enable all exception handler callbacks early Andy Lutomirski <luto@amacapital.net> - 2016-04-04 17:50 +0200
  [tip:x86/asm] x86/traps: Enable all exception handler callbacks  early tip-bot for Andy Lutomirski <tipbot@zytor.com> - 2016-04-13 13:50 +0200

csiph-web