All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Petr Mladek <pmladek@suse.com>,
	Maninder Singh <maninder1.s@samsung.com>
Subject: [PATCH] x86/setup: Deal with "quiet" commandline option earlier
Date: Tue,  4 Sep 2018 16:42:25 +0200	[thread overview]
Message-ID: <20180904144225.14831-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20180904144225.14831-1-hdegoede@redhat.com>

X86's setup_arch() calls parse_early_param() somewhat late, to make
sure that everything is setup correcty to deal with earlyprintk over
the EHCI debug port.

This means that a number of pr_info-s get done before
"early_param("quiet", quiet_kernel)" from init/main.c gets processed.

Until commit 375899cddcbb ("printk: make sure to print log on console.")
this was not a problem because the printk code would evaluate the
console_loglevel vs the message-loglevel when flushing the buffer.

After this commit the check is done at the time that pr_info is actually
called and the console_loglevel at calling time.

This causes the following messages to get printed with the "quiet" option:

[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
...
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x0000000874ffffff] usable

This commit fixes this by making x86's setup_arch() explicitly check for
quiet early on.

Cc: Petr Mladek <pmladek@suse.com>
Cc: Maninder Singh <maninder1.s@samsung.com>
Fixes: 375899cddcbb ("printk: make sure to print log on console.")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/x86/kernel/setup.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b4866badb235..38f66b14cf3d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -93,6 +93,7 @@
 #include <asm/processor.h>
 #include <asm/bugs.h>
 #include <asm/kasan.h>
+#include <asm/cmdline.h>
 
 #include <asm/vsyscall.h>
 #include <asm/cpu.h>
@@ -864,6 +865,16 @@ void __init setup_arch(char **cmdline_p)
 	boot_cpu_data.x86_phys_bits = MAX_PHYSMEM_BITS;
 #endif
 
+#if !defined CONFIG_CMDLINE_BOOL || !defined CONFIG_CMDLINE_OVERRIDE
+	/*
+	 * We call parse_early_param() somewhat late, see x86_configure_nx()
+	 * comment. Deal with "quiet" here to suppress printing of early
+	 * boot messages when quiet has been requested.
+	 */
+	if (cmdline_find_option_bool(boot_command_line, "quiet"))
+		console_loglevel = CONSOLE_LOGLEVEL_QUIET;
+#endif
+
 	/*
 	 * If we have OLPC OFW, we might end up relocating the fixmap due to
 	 * reserve_top(), so do this before touching the ioremap area.
-- 
2.19.0.rc0


  reply	other threads:[~2018-09-04 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 14:42 [PATCH 4.19 regression fix 0/1] x86/setup: Deal with "quiet" commandline op Hans de Goede
2018-09-04 14:42 ` Hans de Goede [this message]
2018-09-04 15:25   ` [PATCH] x86/setup: Deal with "quiet" commandline option earlier Hans de Goede
2018-09-04 18:01     ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180904144225.14831-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=mingo@redhat.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.