/[packages]/cauldron/kernel/current/PATCHES/patches/0047-efi-x86-Call-efi_parse_options-from-efi_main.patch
ViewVC logotype

Contents of /cauldron/kernel/current/PATCHES/patches/0047-efi-x86-Call-efi_parse_options-from-efi_main.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1329221 - (show annotations) (download)
Fri Nov 9 22:05:45 2018 UTC (5 years, 10 months ago) by tmb
File size: 2311 byte(s)
add fixes from sashas autosel queue
1 From 1f44f92bf0e6da6f856ffa41117e7d84f9f84a54 Mon Sep 17 00:00:00 2001
2 From: Hans de Goede <hdegoede@redhat.com>
3 Date: Wed, 12 Sep 2018 20:32:05 +0200
4 Subject: [PATCH 047/145] efi/x86: Call efi_parse_options() from efi_main()
5
6 [ Upstream commit c33ce984435bb6142792802d75513a71e55d1969 ]
7
8 Before this commit we were only calling efi_parse_options() from
9 make_boot_params(), but make_boot_params() only gets called if the
10 kernel gets booted directly as an EFI executable. So when booted through
11 e.g. grub we ended up not parsing the commandline in the boot code.
12
13 This makes the drivers/firmware/efi/libstub code ignore the "quiet"
14 commandline argument resulting in the following message being printed:
15 "EFI stub: UEFI Secure Boot is enabled."
16
17 Despite the quiet request. This commits adds an extra call to
18 efi_parse_options() to efi_main() to make sure that the options are
19 always processed. This fixes quiet not working.
20
21 This also fixes the libstub code ignoring nokaslr and efi=nochunk.
22
23 Reported-by: Peter Robinson <pbrobinson@redhat.com>
24 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
25 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
26 Signed-off-by: Sasha Levin <sashal@kernel.org>
27 ---
28 arch/x86/boot/compressed/eboot.c | 10 ++++++++++
29 1 file changed, 10 insertions(+)
30
31 diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
32 index 1458b1700fc7..8b4c5e001157 100644
33 --- a/arch/x86/boot/compressed/eboot.c
34 +++ b/arch/x86/boot/compressed/eboot.c
35 @@ -738,6 +738,7 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
36 struct desc_struct *desc;
37 void *handle;
38 efi_system_table_t *_table;
39 + unsigned long cmdline_paddr;
40
41 efi_early = c;
42
43 @@ -755,6 +756,15 @@ efi_main(struct efi_config *c, struct boot_params *boot_params)
44 else
45 setup_boot_services32(efi_early);
46
47 + /*
48 + * make_boot_params() may have been called before efi_main(), in which
49 + * case this is the second time we parse the cmdline. This is ok,
50 + * parsing the cmdline multiple times does not have side-effects.
51 + */
52 + cmdline_paddr = ((u64)hdr->cmd_line_ptr |
53 + ((u64)boot_params->ext_cmd_line_ptr << 32));
54 + efi_parse_options((char *)cmdline_paddr);
55 +
56 /*
57 * If the boot loader gave us a value for secure_boot then we use that,
58 * otherwise we ask the BIOS.
59 --
60 2.19.1
61

  ViewVC Help
Powered by ViewVC 1.1.30