All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.19 regression fix 0/1] x86/setup: Deal with "quiet" commandline op
@ 2018-09-04 14:42 Hans de Goede
  2018-09-04 14:42 ` [PATCH] x86/setup: Deal with "quiet" commandline option earlier Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2018-09-04 14:42 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Sergey Senozhatsky
  Cc: Hans de Goede, x86, linux-kernel, Steven Rostedt

Hi All,

While booting 4.19-rc2 for the first time I noticed that it was printing
a bunch of BIOS-e820 mem init messages on the console even though I have
"quiet" on the commandline.

See the commit message of the patch for the cause of this. The patch is
not really pretty (nor really ugly), but it is the best solution I could
come up with.

Regards,

Hans


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

* [PATCH] x86/setup: Deal with "quiet" commandline option earlier
  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
  2018-09-04 15:25   ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2018-09-04 14:42 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Sergey Senozhatsky
  Cc: Hans de Goede, x86, linux-kernel, Steven Rostedt, Petr Mladek,
	Maninder Singh

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


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

* Re: [PATCH] x86/setup: Deal with "quiet" commandline option earlier
  2018-09-04 14:42 ` [PATCH] x86/setup: Deal with "quiet" commandline option earlier Hans de Goede
@ 2018-09-04 15:25   ` Hans de Goede
  2018-09-04 18:01     ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2018-09-04 15:25 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Sergey Senozhatsky
  Cc: x86, linux-kernel, Steven Rostedt, Petr Mladek, Maninder Singh

Hi,

On 04-09-18 16:42, Hans de Goede wrote:
> 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>

Self-nack, I accidentally still had the revert of commit
375899cddcbb ("printk: make sure to print log on console.") in
my tree while testing…

In order for my approach to work, we need to deal with the quiet
option even earlier, before the first pr_notice in init/main.c,
which requires access to the commandline before setup_arch()
which is the function which fills the boot_command_line on
several architectures.

So I think we need to look at a different approach.

I have one more idea, if that does not work out I think we
just need to revert 375899cddcbb ("printk: make sure to print log on console.")

Regards,

Hans




> ---
>   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.
> 

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

* Re: [PATCH] x86/setup: Deal with "quiet" commandline option earlier
  2018-09-04 15:25   ` Hans de Goede
@ 2018-09-04 18:01     ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2018-09-04 18:01 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Sergey Senozhatsky
  Cc: x86, linux-kernel, Steven Rostedt, Petr Mladek, Maninder Singh

Hi,

On 04-09-18 17:25, Hans de Goede wrote:
> Hi,
> 
> On 04-09-18 16:42, Hans de Goede wrote:
>> 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>
> 
> Self-nack, I accidentally still had the revert of commit
> 375899cddcbb ("printk: make sure to print log on console.") in
> my tree while testing…
> 
> In order for my approach to work, we need to deal with the quiet
> option even earlier, before the first pr_notice in init/main.c,
> which requires access to the commandline before setup_arch()
> which is the function which fills the boot_command_line on
> several architectures.
> 
> So I think we need to look at a different approach.
> 
> I have one more idea, if that does not work out I think we
> just need to revert 375899cddcbb ("printk: make sure to print log on console.")

Ok, I have come up with a better, arch neutral fix, which no fully
lives in printk.c. I will keep the To/Cc of the new patch the same
to keep everyone in the loop.

Regards,

Hans


>> ---
>>   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.
>>

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

end of thread, other threads:[~2018-09-04 18:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] x86/setup: Deal with "quiet" commandline option earlier Hans de Goede
2018-09-04 15:25   ` Hans de Goede
2018-09-04 18:01     ` Hans de Goede

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.