[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170411122936.dso2p4o3lqalw6eo@black.fi.intel.com>
Date: Tue, 11 Apr 2017 15:29:36 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Ingo Molnar <mingo@...nel.org>
Cc: dave.hansen@...el.com, luto@...capital.net, tglx@...utronix.de,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
torvalds@...ux-foundation.org, hpa@...or.com, peterz@...radead.org,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/mm] x86/boot/64: Rewrite startup_64() in C
On Tue, Apr 11, 2017 at 10:54:41AM +0200, Ingo Molnar wrote:
>
> * tip-bot for Kirill A. Shutemov <tipbot@...or.com> wrote:
>
> > Commit-ID: 10ee822ec8c53f3987d969ce98b2686323a7fc2a
> > Gitweb: http://git.kernel.org/tip/10ee822ec8c53f3987d969ce98b2686323a7fc2a
> > Author: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> > AuthorDate: Thu, 6 Apr 2017 17:00:59 +0300
> > Committer: Ingo Molnar <mingo@...nel.org>
> > CommitDate: Tue, 11 Apr 2017 08:57:37 +0200
> >
> > x86/boot/64: Rewrite startup_64() in C
> >
> > The patch converts most of the startup_64 logic from assembly to C.
> >
> > This is preparation for 5-level paging enabling.
> >
> > No change in functionality.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > Cc: Andy Lutomirski <luto@...capital.net>
> > Cc: Dave Hansen <dave.hansen@...el.com>
> > Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: linux-arch@...r.kernel.org
> > Cc: linux-mm@...ck.org
> > Link: http://lkml.kernel.org/r/20170406140106.78087-2-kirill.shutemov@linux.intel.com
> > [ Small typo fixes. ]
> > Signed-off-by: Ingo Molnar <mingo@...nel.org>
> > ---
> > arch/x86/kernel/head64.c | 81 ++++++++++++++++++++++++++++++++++++++++-
> > arch/x86/kernel/head_64.S | 93 +----------------------------------------------
> > 2 files changed, 81 insertions(+), 93 deletions(-)
>
> Hm, so I had to zap this commit as it broke booting on a 64-bit Intel and an AMD
> system as well, with defconfig-ish kernels.
The fixup is below. Maybe there's better more idiomatic way, but I'm not
really into assembly.
Basically, we need to preserve %rsi across call __startup_64.
I will post whole thing again once we sort out what to do with the reset
of assembly code I've touched. Or you can apply the fixup, if you feel to.
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 9656c5951b98..1432d530fa35 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -73,7 +73,9 @@ startup_64:
call verify_cpu
leaq _text(%rip), %rdi
+ pushq %rsi
call __startup_64
+ popq %rsi
movq $(early_level4_pgt - __START_KERNEL_map), %rax
jmp 1f
--
Kirill A. Shutemov
Powered by blists - more mailing lists