lkml.org 
[lkml]   [2010]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] x86: Setup early console as early as possible
On Mon, Jul 12, 2010 at 08:47:03AM -0700, H. Peter Anvin wrote:
> On 07/12/2010 01:58 AM, Pekka Enberg wrote:
> > Hi Yinghai,
> >
> > Yinghai Lu wrote:
> >> Analyze "console=uart8250,io,0x3f8,115200n8" in
> >> i386_start_kernel/x86_64_start_kernel,
> >> and call setup_early_serial8250_console() to init early serial console.
> >>
> >> only can handle io port kind of 8250. because mmio need ioremap.
> >>
> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >
> > What's the purpose of this patch? Does it make my early boot I/O patch
> > obsolete?
> >
> > Pekka
>
> No, they're complementary. Your patch serial-port enables the RM
> kernel, whereas Yinghai pushes the initialization earlier in the PM kernel.
>
> Incidentally, Yinghai: it would be possible to push even an MMIO
> reference earlier by reserving a fixmap slot for the early console. I'm
> not sure if it's worth it, though.
>
> -hpa
>

Peter, while reviewing this patch I found another nit in
context of early_param usage, so the patch is below. It's
completely trivial. Actually I thought I've already fixed
all early_param cases long ago but this one somehow sneaked ;)

Anyway, Yinghai, Peter,

I'm not sure but can't we use some boot_param "pad" field for
"being copied" flag instead of new variable? There is a case
when boot_param is used as __initdata and I'm not sure we clear
this section explicitly.

-- Cyrill
---
From: Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [PATCH] early console: Prevent early_param null dereference

In case if user passes "earlycon" without args there will
be null dereference.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
drivers/serial/8250_early.c | 3 +++
1 file changed, 3 insertions(+)

Index: linux-2.6.git/drivers/serial/8250_early.c
=====================================================================
--- linux-2.6.git.orig/drivers/serial/8250_early.c
+++ linux-2.6.git/drivers/serial/8250_early.c
@@ -217,6 +217,9 @@ int __init setup_early_serial8250_consol
char *options;
int err;

+ if (!cmdline)
+ return 0;
+
options = strstr(cmdline, "uart8250,");
if (!options) {
options = strstr(cmdline, "uart,");

\
 
 \ /
  Last update: 2010-07-12 19:47    [W:0.086 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site