mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [Bugfix] x86/boot/compressed: Fix serial I/O during compressed boot
@ 2015-02-08 12:33 Alexander Kuleshov
  2015-02-08 13:39 ` Alexander Kuleshov
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kuleshov @ 2015-02-08 12:33 UTC (permalink / raw)
  To: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, Kees Cook, Vivek Goyal
  Cc: linux-kernel, Andi Kleen, Alexander Kuleshov

Previously it used early_serial_base from the
arch/x86/boot/compressed/early_serial_console.c, and it's zero everytime,
so serial I/O didn't work/print anything in the kernel decompressing code.

Let's define early_serial_base in the arch/x86/boot/early_serial_console.c
and make it extern, so code from boot/compressed directory can use it.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/boot/compressed/early_serial_console.c | 2 --
 arch/x86/boot/compressed/misc.c                 | 3 ++-
 arch/x86/boot/early_serial_console.c            | 2 ++
 arch/x86/boot/tty.c                             | 2 --
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index 261e81f..c80d915 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -1,5 +1,3 @@
 #include "misc.h"
 
-int early_serial_base;
-
 #include "../early_serial_console.c"
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index a950864..2bde4db 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -390,7 +390,8 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
 	lines = real_mode->screen_info.orig_video_lines;
 	cols = real_mode->screen_info.orig_video_cols;
 
-	console_init();
	/* 
	 * serial i/o can be already initialized if we runned in 16-bit 
	 * real mode and didn't use 32/64-bit boot protocol.
	 */
+	if (!early_serial_base)
+		console_init();
 	debug_putstr("early console in decompress_kernel\n");
 
 	free_mem_ptr     = heap;	/* Heap */
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index 5df2869..af32b39 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -1,5 +1,7 @@
 #include "boot.h"
 
+int early_serial_base;
+
 #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */
 
 #define XMTRDY          0x20
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c
index def2451..0cb0b4c 100644
--- a/arch/x86/boot/tty.c
+++ b/arch/x86/boot/tty.c
@@ -15,8 +15,6 @@
 
 #include "boot.h"
 
-int early_serial_base;
-
 #define XMTRDY          0x20
 
 #define TXR             0       /*  Transmit register (WRITE) */
-- 
2.3.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [Bugfix] x86/boot/compressed: Fix serial I/O during compressed boot
  2015-02-08 12:33 [PATCH] [Bugfix] x86/boot/compressed: Fix serial I/O during compressed boot Alexander Kuleshov
@ 2015-02-08 13:39 ` Alexander Kuleshov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kuleshov @ 2015-02-08 13:39 UTC (permalink / raw)
  To: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, Kees Cook, Vivek Goyal
  Cc: linux-kernel, Andi Kleen, Alexander Kuleshov

rejected

2015-02-08 18:33 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
> Previously it used early_serial_base from the
> arch/x86/boot/compressed/early_serial_console.c, and it's zero everytime,
> so serial I/O didn't work/print anything in the kernel decompressing code.
>
> Let's define early_serial_base in the arch/x86/boot/early_serial_console.c
> and make it extern, so code from boot/compressed directory can use it.
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/x86/boot/compressed/early_serial_console.c | 2 --
>  arch/x86/boot/compressed/misc.c                 | 3 ++-
>  arch/x86/boot/early_serial_console.c            | 2 ++
>  arch/x86/boot/tty.c                             | 2 --
>  4 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
> index 261e81f..c80d915 100644
> --- a/arch/x86/boot/compressed/early_serial_console.c
> +++ b/arch/x86/boot/compressed/early_serial_console.c
> @@ -1,5 +1,3 @@
>  #include "misc.h"
>
> -int early_serial_base;
> -
>  #include "../early_serial_console.c"
> diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
> index a950864..2bde4db 100644
> --- a/arch/x86/boot/compressed/misc.c
> +++ b/arch/x86/boot/compressed/misc.c
> @@ -390,7 +390,8 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
>         lines = real_mode->screen_info.orig_video_lines;
>         cols = real_mode->screen_info.orig_video_cols;
>
> -       console_init();
>         /*
>          * serial i/o can be already initialized if we runned in 16-bit
>          * real mode and didn't use 32/64-bit boot protocol.
>          */
> +       if (!early_serial_base)
> +               console_init();
>         debug_putstr("early console in decompress_kernel\n");
>
>         free_mem_ptr     = heap;        /* Heap */
> diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
> index 5df2869..af32b39 100644
> --- a/arch/x86/boot/early_serial_console.c
> +++ b/arch/x86/boot/early_serial_console.c
> @@ -1,5 +1,7 @@
>  #include "boot.h"
>
> +int early_serial_base;
> +
>  #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */
>
>  #define XMTRDY          0x20
> diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c
> index def2451..0cb0b4c 100644
> --- a/arch/x86/boot/tty.c
> +++ b/arch/x86/boot/tty.c
> @@ -15,8 +15,6 @@
>
>  #include "boot.h"
>
> -int early_serial_base;
> -
>  #define XMTRDY          0x20
>
>  #define TXR             0       /*  Transmit register (WRITE) */
> --
> 2.3.0
>



-- 
_________________________
0xAX

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-08 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-08 12:33 [PATCH] [Bugfix] x86/boot/compressed: Fix serial I/O during compressed boot Alexander Kuleshov
2015-02-08 13:39 ` Alexander Kuleshov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®