]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/boot: Pull up cmdline preparation and early param parsing
authorBorislav Petkov <bp@suse.de>
Fri, 5 Nov 2021 09:41:51 +0000 (10:41 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 15 Nov 2021 11:27:40 +0000 (12:27 +0100)
commit8d48bf8206f77aa8687f0e241e901e5197e52423
tree4be3950c9aa06a209aa1e8dcb8c2ffde81afa6fd
parentfa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf
x86/boot: Pull up cmdline preparation and early param parsing

Dan reports that Anjaneya Chagam can no longer use the efi=nosoftreserve
kernel command line parameter to suppress "soft reservation" behavior.

This is due to the fact that the following call-chain happens at boot:

early_reserve_memory
|-> efi_memblock_x86_reserve_range
    |-> efi_fake_memmap_early

which does

        if (!efi_soft_reserve_enabled())
                return;

and that would have set EFI_MEM_NO_SOFT_RESERVE after having parsed
"nosoftreserve".

However, parse_early_param() gets called *after* it, leading to the boot
cmdline not being taken into account.

Therefore, carve out the command line preparation into a separate
function which does the early param parsing too. So that it all goes
together.

And then call that function before early_reserve_memory() so that the
params would have been parsed by then.

Fixes: 8aa83e6395ce ("x86/setup: Call early_reserve_memory() earlier")
Reported-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Anjaneya Chagam <anjaneya.chagam@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/e8dd8993c38702ee6dd73b3c11f158617e665607.camel@intel.com
arch/x86/kernel/setup.c