lkml.org 
[lkml]   [2020]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 30/62] x86/head/64: Move early exception dispatch to C code
On Tue, Feb 11, 2020 at 5:53 AM Joerg Roedel <joro@8bytes.org> wrote:
>
> From: Joerg Roedel <jroedel@suse.de>
>
> 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 <jroedel@suse.de>
> ---
> 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

\
 
 \ /
  Last update: 2020-02-11 23:45    [W:0.214 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site