public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y
@ 2023-02-28  1:01 Masami Hiramatsu (Google)
  2023-02-28  5:01 ` Paul E. McKenney
  2023-03-01 14:05 ` Mukesh Ojha
  0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2023-02-28  1:01 UTC (permalink / raw)
  To: linux-trace-kernel, Paul E . McKenney
  Cc: Geert Uytterhoeven, linux-kernel, akpm, ndesaulniers, vbabka,
	hannes, joel, quic_neeraju, urezki, mhiramat

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Change no bootconfig data error message if user do not specify 'bootconfig'
option but CONFIG_BOOT_CONFIG_FORCE=y.
With CONFIG_BOOT_CONFIG_FORCE=y, the kernel proceeds bootconfig check even
if user does not specify 'bootconfig' option. So the current error message
is confusing. Let's show just an information message to notice skipping
the bootconfig in that case.

Fixes: b743852ccc1d ("Allow forcing unconditional bootconfig processing")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/all/CAMuHMdV9jJvE2y8gY5V_CxidUikCf5515QMZHzTA3rRGEOj6=w@mail.gmail.com/
Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 init/main.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/init/main.c b/init/main.c
index 4425d1783d5c..bb87b789c543 100644
--- a/init/main.c
+++ b/init/main.c
@@ -156,7 +156,7 @@ static char *extra_init_args;
 
 #ifdef CONFIG_BOOT_CONFIG
 /* Is bootconfig on command line? */
-static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
+static bool bootconfig_found;
 static size_t initargs_offs;
 #else
 # define bootconfig_found false
@@ -429,7 +429,7 @@ static void __init setup_boot_config(void)
 	err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
 			 bootconfig_params);
 
-	if (IS_ERR(err) || !bootconfig_found)
+	if (IS_ERR(err) || !(bootconfig_found || IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)))
 		return;
 
 	/* parse_args() stops at the next param of '--' and returns an address */
@@ -437,7 +437,11 @@ static void __init setup_boot_config(void)
 		initargs_offs = err - tmp_cmdline;
 
 	if (!data) {
-		pr_err("'bootconfig' found on command line, but no bootconfig found\n");
+		/* If user intended to use bootconfig, show an error level message */
+		if (bootconfig_found)
+			pr_err("'bootconfig' found on command line, but no bootconfig found\n");
+		else
+			pr_info("No bootconfig data provided, so skipping bootconfig");
 		return;
 	}
 


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

* Re: [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y
  2023-02-28  1:01 [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y Masami Hiramatsu (Google)
@ 2023-02-28  5:01 ` Paul E. McKenney
  2023-03-01 14:05 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2023-02-28  5:01 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: linux-trace-kernel, Geert Uytterhoeven, linux-kernel, akpm,
	ndesaulniers, vbabka, hannes, joel, quic_neeraju, urezki

On Tue, Feb 28, 2023 at 10:01:42AM +0900, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Change no bootconfig data error message if user do not specify 'bootconfig'
> option but CONFIG_BOOT_CONFIG_FORCE=y.
> With CONFIG_BOOT_CONFIG_FORCE=y, the kernel proceeds bootconfig check even
> if user does not specify 'bootconfig' option. So the current error message
> is confusing. Let's show just an information message to notice skipping
> the bootconfig in that case.
> 
> Fixes: b743852ccc1d ("Allow forcing unconditional bootconfig processing")
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Link: https://lore.kernel.org/all/CAMuHMdV9jJvE2y8gY5V_CxidUikCf5515QMZHzTA3rRGEOj6=w@mail.gmail.com/
> Suggested-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Tested-by: Paul E. McKenney <paulmck@kernel.org>

> ---
>  init/main.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/init/main.c b/init/main.c
> index 4425d1783d5c..bb87b789c543 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -156,7 +156,7 @@ static char *extra_init_args;
>  
>  #ifdef CONFIG_BOOT_CONFIG
>  /* Is bootconfig on command line? */
> -static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> +static bool bootconfig_found;
>  static size_t initargs_offs;
>  #else
>  # define bootconfig_found false
> @@ -429,7 +429,7 @@ static void __init setup_boot_config(void)
>  	err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
>  			 bootconfig_params);
>  
> -	if (IS_ERR(err) || !bootconfig_found)
> +	if (IS_ERR(err) || !(bootconfig_found || IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)))
>  		return;
>  
>  	/* parse_args() stops at the next param of '--' and returns an address */
> @@ -437,7 +437,11 @@ static void __init setup_boot_config(void)
>  		initargs_offs = err - tmp_cmdline;
>  
>  	if (!data) {
> -		pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> +		/* If user intended to use bootconfig, show an error level message */
> +		if (bootconfig_found)
> +			pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> +		else
> +			pr_info("No bootconfig data provided, so skipping bootconfig");
>  		return;
>  	}
>  
> 

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

* Re: [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y
  2023-02-28  1:01 [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y Masami Hiramatsu (Google)
  2023-02-28  5:01 ` Paul E. McKenney
@ 2023-03-01 14:05 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2023-03-01 14:05 UTC (permalink / raw)
  To: Masami Hiramatsu (Google), linux-trace-kernel, Paul E . McKenney
  Cc: Geert Uytterhoeven, linux-kernel, akpm, ndesaulniers, vbabka,
	hannes, joel, quic_neeraju, urezki



On 2/28/2023 6:31 AM, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Change no bootconfig data error message if user do not specify 'bootconfig'
> option but CONFIG_BOOT_CONFIG_FORCE=y.
> With CONFIG_BOOT_CONFIG_FORCE=y, the kernel proceeds bootconfig check even
> if user does not specify 'bootconfig' option. So the current error message
> is confusing. Let's show just an information message to notice skipping
> the bootconfig in that case.
> 
> Fixes: b743852ccc1d ("Allow forcing unconditional bootconfig processing")
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Link: https://lore.kernel.org/all/CAMuHMdV9jJvE2y8gY5V_CxidUikCf5515QMZHzTA3rRGEOj6=w@mail.gmail.com/
> Suggested-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
>   init/main.c |   10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/init/main.c b/init/main.c
> index 4425d1783d5c..bb87b789c543 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -156,7 +156,7 @@ static char *extra_init_args;
>   
>   #ifdef CONFIG_BOOT_CONFIG
>   /* Is bootconfig on command line? */
> -static bool bootconfig_found = IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE);
> +static bool bootconfig_found;
>   static size_t initargs_offs;
>   #else
>   # define bootconfig_found false
> @@ -429,7 +429,7 @@ static void __init setup_boot_config(void)
>   	err = parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
>   			 bootconfig_params);
>   
> -	if (IS_ERR(err) || !bootconfig_found)
> +	if (IS_ERR(err) || !(bootconfig_found || IS_ENABLED(CONFIG_BOOT_CONFIG_FORCE)))
>   		return;
>   
>   	/* parse_args() stops at the next param of '--' and returns an address */
> @@ -437,7 +437,11 @@ static void __init setup_boot_config(void)
>   		initargs_offs = err - tmp_cmdline;
>   
>   	if (!data) {
> -		pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> +		/* If user intended to use bootconfig, show an error level message */
> +		if (bootconfig_found)
> +			pr_err("'bootconfig' found on command line, but no bootconfig found\n");
> +		else
> +			pr_info("No bootconfig data provided, so skipping bootconfig");


Acked-by: Mukesh Ojha <quic_mojha@quicinc.com>

-Mukesh

>   		return;
>   	}
>   
> 

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

end of thread, other threads:[~2023-03-01 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28  1:01 [PATCH] bootconfig: Change message if no bootconfig with CONFIG_BOOT_CONFIG_FORCE=y Masami Hiramatsu (Google)
2023-02-28  5:01 ` Paul E. McKenney
2023-03-01 14:05 ` Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox