Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932977AbbFILMH (ORCPT ); Tue, 9 Jun 2015 07:12:07 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:36102 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932626AbbFILLi (ORCPT ); Tue, 9 Jun 2015 07:11:38 -0400 From: Alexander Kuleshov To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Alexander Kuleshov , Andy Shevchenko , LKML , Greg Kroah-Hartman , Borislav Petkov , Mark Rustad , Yinghai Lu Subject: [PATCH v11 3/5] x86/earlyprintk: Allocate early log_buf as early as possible Date: Tue, 9 Jun 2015 17:11:33 +0600 Message-Id: <1433848293-5228-1-git-send-email-kuleshovmail@gmail.com> X-Mailer: git-send-email 2.4.0.GIT In-Reply-To: <1433848247-3550-1-git-send-email-kuleshovmail@gmail.com> References: <1433848247-3550-1-git-send-email-kuleshovmail@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2693 Lines: 93 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. We need to do it because without it we will not see earlyprintk messages in the kernel log. Signed-off-by: Alexander Kuleshov --- arch/x86/kernel/head32.c | 6 ++++++ arch/x86/kernel/head64.c | 5 +++++ arch/x86/kernel/setup.c | 3 --- kernel/printk/printk.c | 5 +++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index 92e8b5f..f28d10f 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c @@ -32,2 +32,2 @@ static void __init i386_default_early_setup(void) asmlinkage __visible void __init i386_start_kernel(void) { setup_builtin_cmdline(); + + lockdep_init(); + + /* Allocate early log buffer */ + setup_log_buf(1); + cr4_init_shadow(); sanitize_boot_params(&boot_params); diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 1e5f064..53662d2 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -174,0 +174,0 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) setup_builtin_cmdline(); + lockdep_init(); + + /* Allocate early log buffer */ + setup_log_buf(1); + /* * Load microcode early on BSP. */ diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 0aeee0a..edfdb6a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1146,9 +1146,6 @@ void __init setup_arch(char **cmdline_p) if (init_ohci1394_dma_early) init_ohci1394_dma_on_all_controllers(); #endif - /* Allocate bigger log buffer */ - setup_log_buf(1); - reserve_initrd(); #if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index c099b08..d76a032 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1913,6 +1913,7 @@ asmlinkage __visible void early_printk(const char *fmt, ...) va_list ap; char buf[512]; int n; + printk_func_t vprintk_func; if (!early_console) return; @@ -1922,7 +1923,10 @@ asmlinkage __visible void early_printk(const char *fmt, ...) va_end(ap); early_console->write(early_console, buf, n); + + /* Store earlyprintk messages in the log_buf */ + vprintk_func = this_cpu_read(printk_func); + vprintk_func(fmt, ap); } #endif -- 2.4.0.GIT -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/