]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: cpufeatures: Fix handling of CONFIG_CMDLINE for idreg overrides
authorWill Deacon <will@kernel.org>
Wed, 3 Mar 2021 13:49:26 +0000 (13:49 +0000)
committerWill Deacon <will@kernel.org>
Mon, 8 Mar 2021 12:56:34 +0000 (12:56 +0000)
commite287f2f812feac960c7149d45bb2c32ef8428781
tree90f1042b8485fa7d4474a7b9cc06be0e55ecc48e
parent1b8bd930b05ba1f659bccfc6ef406e93916f57ed
arm64: cpufeatures: Fix handling of CONFIG_CMDLINE for idreg overrides

The built-in kernel commandline (CONFIG_CMDLINE) can be configured in
three different ways:

  1. CMDLINE_FORCE: Use CONFIG_CMDLINE instead of any bootloader args
  2. CMDLINE_EXTEND: Append the bootloader args to CONFIG_CMDLINE
  3. CMDLINE_FROM_BOOTLOADER: Only use CONFIG_CMDLINE if there aren't
     any bootloader args.

The early cmdline parsing to detect idreg overrides gets (2) and (3)
slightly wrong: in the case of (2) the bootloader args are parsed first
and in the case of (3) the CMDLINE is always parsed.

Fix these issues by moving the bootargs parsing out into a helper
function and following the same logic as that used by the EFI stub.

Reviewed-by: Marc Zyngier <maz@kernel.org>
Fixes: 5c20ca422ec8 ("arm64: cpufeature: Add an early command-line cpufeature override facility")
Link: https://lore.kernel.org/r/20210303134927.18975-2-will@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/idreg-override.c