Skip to content

arm64: Implement CONFIG_CMDLINE_EXTEND

Tyler Hicks linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to arm64 (for-next/cmdline-extended), thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2arm64: kaslr: Refactor early init command line parsingarch/arm64/kernel/kaslr.c+11 -80 replies
2/2arm64: Extend the kernel command line from the bootloaderarch/arm64/Kconfig arch/arm64/kernel/kaslr.c+30 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] arm64: Implement CONFIG_CMDLINE_EXTEND

Provide the CONFIG_CMDLINE_EXTEND config option for arm64 kernels. This config option can be used to extend the kernel command line parameters, specified by the bootloader, with additional command line parameters specified in the kernel configuration.

This option addresses the following use cases:

1) Switching between stable and development kernel versions, where one of the versions benefits from additional command line parameters, such as debugging options.
2) Specifying additional command line parameters, for additional tuning or debugging, when the bootloader does not offer an interactive mode.

After implementing these patches, I noticed that a previous attempt has been made to upstream CONFIG_CMDLINE_EXTEND support in arm64:

https://lore.kernel.org/linux-arm-kernel/[email protected]/

I don't believe that the previous objection still holds as the generic command line parsing series hasn't been revised in over a year.

This series is based on commit f322010a08da ("Merge branch 'for-next/mte' into for-next/core") of the for-next/core branch of the arm64 tree.

Below is a summary of testing that I performed.

Upgrade testing:

* CONFIG_CMDLINE unset
- oldconfig target doesn't prompt,
* CONFIG_CMDLINE set, CONFIG_CMDLINE_FORCE unset
- oldconfig target prompts for command line type with default choice set to CONFIG_CMDLINE_FROM_BOOTLOADER
* CONFIG_CMDLINE set, CONFIG_CMDLINE_FORCE set
- oldconfig target prompts for command line type with default choice set to CONFIG_CMDLINE_FORCE

Functional testing:

* Set CONFIG_CMDLINE="nokaslr apparmor=0" and CONFIG_CMDLINE_EXTEND=y to test early init parsing and regular parsing
- /proc/cmdline shows that "nokaslr apparmor=0" was appended to the end of the bootloader supplied command line
- "KASLR disabled on command line" found in dmesg
- AppArmor is disabled. /sys/kernel/security/apparmor does not exist and aa-status prints:
apparmor module is loaded.
apparmor filesystem is not mounted.
* Set CONFIG_CMDLINE="nokaslr apparmor=0", CONFIG_CMDLINE_FROM_BOOTLOADER=y, and have the bootloader specify a command line without those options
- The bootloader's command line is used and does not contain CONFIG_CMDLINE's value
- AppArmor and KASLR are enabled
* Set CONFIG_CMDLINE="nokaslr apparmor=0" and CONFIG_CMDLINE_FORCE=y
- The CONFIG_CMDLINE value is used and does not contain the bootloader's command line
- AppArmor and KASLR are disabled

Tyler

Tyler Hicks (2):
arm64: kaslr: Refactor early init command line parsing
arm64: Extend the kernel command line from the bootloader

 arch/arm64/Kconfig        | 23 ++++++++++++++++++++++-
 arch/arm64/kernel/kaslr.c | 26 ++++++++++++++++++--------
 2 files changed, 40 insertions(+), 9 deletions(-)
Signature · 1 line
2.25.1