Re: [PATCH v11 3/5] x86/earlyprintk: Allocate early log_buf as early as possible

From: Alexander Kuleshov
Date: Tue Jun 09 2015 - 14:05:08 EST


On Tue, Jun 09, 2015 at 06:58:52PM +0300, Andy Shevchenko wrote:
>> On Tue, 2015-06-09 at 17:11 +0600, Alexander Kuleshov wrote:
>> > This patch moves call of the early setup_log_buf from the
>> > arch/x86/kernel/setup.c to the arch/x86/kernel/head{32,64}.c
>> > and updates log_buf with the earlyprintk messages.
>> >
>>
>> Didn't mention lockdep_init() change. Regarding to what Borislav told
>> you how do you handle double call of lockdep_init()?
>>

Double call of the lockdep_init is safe, since it has

if (lockdep_initialized)
return;

at the beginning. Will update commit message with it.

>> Also, when you print the same message to the serial and to kernel
>> buffer, do you avoid duplication? Your early_printk messages needs flag
>> LOG_NOCONS if I understand correctly.

Yes, just checked. They will be duplicated. Thanks for advice about LOG_NOCONS.

Borislav, I'm really not sure too, that using of printk to update
log_buf with the earlyprintk
is a right correct here. So, we can update log_buf with earlyprintk
messages with the call
of the

log_store(0, LOGLEVEL_DEFAULT, LOG_NOCONS|LOG_CONT, 0, NULL, 0,
buf, strlen(buf));

in the early_printk function. What do you think about it?

Do we need to see earlyprintk messages in the dmesg output? Maybe
there need to create yet another option, something like:

CONFIG_EARLY_PRINTK_KERNEL_LOG

or something like this?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/