diff mbox series

efistub: add efi=quiet parameter to selectively silence efistub alone

Message ID 20250117024452.2691546-1-linux@t4c.dev
State New
Headers show
Series efistub: add efi=quiet parameter to selectively silence efistub alone | expand

Commit Message

Hendrik 'T4cC0re' Meyer Jan. 17, 2025, 2:44 a.m. UTC
While the general `quiet` kernel parameter is available to silence
output from the efistub, setting this comes with side-effects.
This patch adds a parameter efi=quiet to selectively set the loglevel
for the stub alone to quiet, as the polar oppoosite to efi=debug.

Signed-off-by: Hendrik 'T4cC0re' Meyer <linux@t4c.dev>
---
 Documentation/admin-guide/kernel-parameters.txt | 3 ++-
 drivers/firmware/efi/libstub/efi-stub-helper.c  | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Ard Biesheuvel Jan. 19, 2025, 5:11 p.m. UTC | #1
On Fri, 17 Jan 2025 at 03:46, Hendrik 'T4cC0re' Meyer <linux@t4c.dev> wrote:
>
> While the general `quiet` kernel parameter is available to silence
> output from the efistub, setting this comes with side-effects.
> This patch adds a parameter efi=quiet to selectively set the loglevel
> for the stub alone to quiet, as the polar oppoosite to efi=debug.
>
> Signed-off-by: Hendrik 'T4cC0re' Meyer <linux@t4c.dev>
> ---
>  Documentation/admin-guide/kernel-parameters.txt | 3 ++-
>  drivers/firmware/efi/libstub/efi-stub-helper.c  | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 3872bc6ec..94a2f6ae7 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -1454,7 +1454,7 @@
>         efi=            [EFI,EARLY]
>                         Format: { "debug", "disable_early_pci_dma",
>                                   "nochunk", "noruntime", "nosoftreserve",
> -                                 "novamap", "no_disable_early_pci_dma" }
> +                                 "novamap", "no_disable_early_pci_dma", "quiet" }
>                         debug: enable misc debug output.
>                         disable_early_pci_dma: disable the busmaster bit on all
>                         PCI bridges while in the EFI boot stub.
> @@ -1471,6 +1471,7 @@
>                         novamap: do not call SetVirtualAddressMap().
>                         no_disable_early_pci_dma: Leave the busmaster bit set
>                         on all PCI bridges while in the EFI boot stub
> +                       quiet: disable most log messages.
>
>         efi_no_storage_paranoia [EFI,X86,EARLY]
>                         Using this parameter you can use more than 50% of
> diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
> index c0c81ca42..b8ad629cc 100644
> --- a/drivers/firmware/efi/libstub/efi-stub-helper.c
> +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
> @@ -97,6 +97,8 @@ efi_status_t efi_parse_options(char const *cmdline)
>                                 efi_disable_pci_dma = false;
>                         if (parse_option_str(val, "debug"))
>                                 efi_loglevel = CONSOLE_LOGLEVEL_DEBUG;
> +                       if (parse_option_str(val, "quiet"))
> +                               efi_loglevel = CONSOLE_LOGLEVEL_QUIET;
>                 } else if (!strcmp(param, "video") &&
>                            val && strstarts(val, "efifb:")) {
>                         efi_parse_option_graphics(val + strlen("efifb:"));

Hello Hendrik,

Could you explain the use case please? Your concern is that removing
'quiet' from the command line is producing a few additional lines of
output from the EFI stub at boot? How is that a problem compared to
the fact that you get the entire kernel log printed to the console? Is
every single line printed there relevant to you, and only the ones
emitted by the EFI stub are not?
diff mbox series

Patch

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 3872bc6ec..94a2f6ae7 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1454,7 +1454,7 @@ 
 	efi=		[EFI,EARLY]
 			Format: { "debug", "disable_early_pci_dma",
 				  "nochunk", "noruntime", "nosoftreserve",
-				  "novamap", "no_disable_early_pci_dma" }
+				  "novamap", "no_disable_early_pci_dma", "quiet" }
 			debug: enable misc debug output.
 			disable_early_pci_dma: disable the busmaster bit on all
 			PCI bridges while in the EFI boot stub.
@@ -1471,6 +1471,7 @@ 
 			novamap: do not call SetVirtualAddressMap().
 			no_disable_early_pci_dma: Leave the busmaster bit set
 			on all PCI bridges while in the EFI boot stub
+			quiet: disable most log messages.
 
 	efi_no_storage_paranoia [EFI,X86,EARLY]
 			Using this parameter you can use more than 50% of
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index c0c81ca42..b8ad629cc 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -97,6 +97,8 @@  efi_status_t efi_parse_options(char const *cmdline)
 				efi_disable_pci_dma = false;
 			if (parse_option_str(val, "debug"))
 				efi_loglevel = CONSOLE_LOGLEVEL_DEBUG;
+			if (parse_option_str(val, "quiet"))
+				efi_loglevel = CONSOLE_LOGLEVEL_QUIET;
 		} else if (!strcmp(param, "video") &&
 			   val && strstarts(val, "efifb:")) {
 			efi_parse_option_graphics(val + strlen("efifb:"));