[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1557208860-12846-2-git-send-email-kernelfans@gmail.com>
Date: Tue, 7 May 2019 14:01:00 +0800
From: Pingfan Liu <kernelfans@...il.com>
To: x86@...nel.org
Cc: Pingfan Liu <kernelfans@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Jordan Borgner <mail@...dan-borgner.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] x86/boot: push console_init forward
At the very early boot stage, early console is badly needed. Push its
initialization as early as possible, just after stack is ready.
Signed-off-by: Pingfan Liu <kernelfans@...il.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Jordan Borgner <mail@...dan-borgner.de>
Cc: linux-kernel@...r.kernel.org
---
arch/x86/boot/compressed/early_serial_console.c | 7 +++++++
arch/x86/boot/compressed/head_64.S | 4 ++++
arch/x86/boot/compressed/misc.c | 1 -
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index 624e334..223954a 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -3,3 +3,10 @@
int early_serial_base = -1;
#include "../early_serial_console.c"
+
+void early_console_init(void *rmode)
+{
+ boot_params = rmode;
+ console_init();
+ debug_putstr("early console is ready\n");
+}
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index fafb75c..e4a25f9 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -323,6 +323,10 @@ ENTRY(startup_64)
subq $1b, %rdi
call adjust_got
+ pushq %rsi
+ movq %rsi, %rdi
+ call early_console_init
+ popq %rsi
/*
* At this point we are in long mode with 4-level paging enabled,
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index cafc6aa..475a3c6 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -368,7 +368,6 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap,
lines = boot_params->screen_info.orig_video_lines;
cols = boot_params->screen_info.orig_video_cols;
- console_init();
debug_putstr("early console in extract_kernel\n");
free_mem_ptr = heap; /* Heap */
--
2.7.4
Powered by blists - more mailing lists