Thread (107 messages) 107 messages, 8 authors, 2020-03-17

Re: [PATCH 30/62] x86/head/64: Move early exception dispatch to C code

From: Andy Lutomirski <luto@kernel.org>
Date: 2020-02-11 22:45:00
Also in: kvm, lkml

On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Joerg Roedel <redacted>

Move the assembly coded dispatch between page-faults and all other
exceptions to C code to make it easier to maintain and extend.

Signed-off-by: Joerg Roedel <redacted>
---
 arch/x86/kernel/head64.c  | 20 ++++++++++++++++++++
 arch/x86/kernel/head_64.S | 11 +----------
 2 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 7cdfb7113811..d83c62ebaa85 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -36,6 +36,8 @@
 #include <asm/microcode.h>
 #include <asm/kasan.h>
 #include <asm/fixmap.h>
+#include <asm/extable.h>
+#include <asm/trap_defs.h>

 /*
  * Manage page tables very early on.
@@ -377,6 +379,24 @@ int __init early_make_pgtable(unsigned long address)
        return __early_make_pgtable(address, pmd);
 }

+void __init early_exception(struct pt_regs *regs, int trapnr)
+{
+       unsigned long cr2;
+       int r;
How about int (or bool) handled;  Or just if (!early_make_pgtable)
return;  This would also be nicer if you inverted the return value so
that true means "I handled it".

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help