diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-16 04:31:59 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-16 04:31:59 +0200 |
commit | 4578d072fa8f840d2492e1bba30871dbe1e9609a (patch) | |
tree | 4e97557a757c933e627b63f2485b00a30f9430a3 /arch/x86/lib | |
parent | Merge tag 'x86_alternatives_for_v6.11_rc1' of git://git.kernel.org/pub/scm/li... (diff) | |
parent | x86/setup: Warn when option parsing is done too early (diff) | |
download | linux-4578d072fa8f840d2492e1bba30871dbe1e9609a.tar.xz linux-4578d072fa8f840d2492e1bba30871dbe1e9609a.zip |
Merge tag 'x86_boot_for_v6.11_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Borislav Petkov:
- Add a check to warn when cmdline parsing happens before the final
cmdline string has been built and thus arguments can get lost
- Code cleanups and simplifications
* tag 'x86_boot_for_v6.11_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/setup: Warn when option parsing is done too early
x86/boot: Clean up the arch/x86/boot/main.c code a bit
x86/boot: Use current_stack_pointer to avoid asm() in init_heap()
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/cmdline.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/lib/cmdline.c b/arch/x86/lib/cmdline.c index 80570eb3c89b..384da1fdd5c6 100644 --- a/arch/x86/lib/cmdline.c +++ b/arch/x86/lib/cmdline.c @@ -6,8 +6,10 @@ #include <linux/kernel.h> #include <linux/string.h> #include <linux/ctype.h> + #include <asm/setup.h> #include <asm/cmdline.h> +#include <asm/bug.h> static inline int myisspace(u8 c) { @@ -205,12 +207,18 @@ __cmdline_find_option(const char *cmdline, int max_cmdline_size, int cmdline_find_option_bool(const char *cmdline, const char *option) { + if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) + WARN_ON_ONCE(!builtin_cmdline_added); + return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); } int cmdline_find_option(const char *cmdline, const char *option, char *buffer, int bufsize) { + if (IS_ENABLED(CONFIG_CMDLINE_BOOL)) + WARN_ON_ONCE(!builtin_cmdline_added); + return __cmdline_find_option(cmdline, COMMAND_LINE_SIZE, option, buffer, bufsize); } |