generic command line v5
Subsystems (7)
cover generic command line v5
v5 release changes. Generally a rebase from v4.
* Modified OF changes to move the ugly code into the cmdline.h
* Minor compliation update in arm64. Added ifndef __ASSEMBLY__ in a few places.
* Worked around arm64 kaslr_early.c.
This code needs some additional review and consideration. It appears this code is missing the opposite option to nokaslr which is kaslr.disabled=1/0 which would allow kaslr to be turn back on later in the command line. For example,
console=ttyS0 nokaslr root=/dev/ram0 nosmp kaslr.disabled=0 loglevel=7
On arm64 in arch/arm64/kernel/idreg-override.c this is parsed correctly to turn on kaslr, but the kaslr_early.c is missing this logic. Doing this results in kaslr getting disabled with the following message,
KASLR disabled due to lack of seed
Even when there is a seed in the device tree.
So change to the generic command line would leave built in command lines with nokaslr with no option to re-enable kaslr in in the bootloader arguments.
Daniel Walker (8):
CMDLINE: add generic builtin command line
scripts: insert-sys-cert: add command line insert capability
scripts: insert-sys-cert: change name to insert-symbol
CMDLINE: mips: convert to generic builtin command line
drivers: firmware: efi: libstub: enable generic commandline
CMDLINE: x86: convert to generic builtin command line
of: replace command line handling
CMDLINE: arm64: convert to generic builtin command line
arch/arm64/Kconfig | 33 +--
arch/arm64/include/asm/setup.h | 4 +
arch/arm64/include/uapi/asm/setup.h | 2 +
arch/arm64/kernel/idreg-override.c | 9 +-
arch/arm64/kernel/pi/kaslr_early.c | 14 +-
arch/mips/Kconfig | 4 +-
arch/mips/Kconfig.debug | 44 ----
arch/mips/configs/ar7_defconfig | 9 +-
arch/mips/configs/bcm47xx_defconfig | 8 +-
arch/mips/configs/bcm63xx_defconfig | 15 +-
arch/mips/configs/bmips_be_defconfig | 11 +-
arch/mips/configs/bmips_stb_defconfig | 6 +-
arch/mips/configs/ci20_defconfig | 9 +-
arch/mips/configs/cu1000-neo_defconfig | 10 +-
arch/mips/configs/cu1830-neo_defconfig | 10 +-
arch/mips/configs/generic_defconfig | 6 +-
arch/mips/configs/gpr_defconfig | 18 +-
arch/mips/configs/loongson3_defconfig | 12 +-
arch/mips/include/asm/setup.h | 2 +
arch/mips/kernel/relocate.c | 17 +-
arch/mips/kernel/setup.c | 36 +--
arch/mips/pic32/pic32mzda/early_console.c | 2 +-
arch/mips/pic32/pic32mzda/init.c | 3 +-
arch/x86/Kconfig | 44 +---
arch/x86/kernel/setup.c | 18 +-
.../firmware/efi/libstub/efi-stub-helper.c | 29 +++
drivers/firmware/efi/libstub/efi-stub.c | 9 +
drivers/firmware/efi/libstub/efistub.h | 1 +
drivers/firmware/efi/libstub/x86-stub.c | 13 +-
drivers/of/fdt.c | 22 +-
include/linux/cmdline.h | 137 ++++++++++
init/Kconfig | 78 ++++++
lib/Kconfig | 4 +
lib/Makefile | 3 +
lib/generic_cmdline.S | 53 ++++
lib/test_cmdline1.c | 139 ++++++++++
scripts/Makefile | 2 +-
.../{insert-sys-cert.c => insert-symbol.c} | 243 ++++++++++++------
38 files changed, 724 insertions(+), 355 deletions(-)
create mode 100644 include/linux/cmdline.h
create mode 100644 lib/generic_cmdline.S
create mode 100644 lib/test_cmdline1.c
rename scripts/{insert-sys-cert.c => insert-symbol.c} (72%)Signature · 1 line
2.25.1
PATCH 1/8 CMDLINE: add generic builtin command line
This code allows architectures to use a generic builtin command line. The state of the builtin command line options across architecture is diverse. MIPS and X86 once has similar systems, then mips added some options to allow extending the command line. Powerpc did something simiar in adding the ability to extend. Even with mips and powerpc enhancement the needs of Cisco are not met on these platforms.
The code in this commit unifies the code into a generic header file under the CONFIG_GENERIC_CMDLINE option. When this option is enabled the architecture can call the cmdline_add_builtin() to add the builtin command line. The generic code provides both append and/or prepend options and provides a way to redefine these option after the kernel is compiled.
This code also includes test's which are meant to confirm functionality.
This unified implementation offers the same functionality needed by Cisco on all platform which we enable it on.
--- include/linux/cmdline.h | 106 ++++++++++++++++++++++++++++++ init/Kconfig | 78 ++++++++++++++++++++++ lib/Kconfig | 4 ++ lib/Makefile | 3 + lib/generic_cmdline.S | 53 +++++++++++++++ lib/test_cmdline1.c | 139 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 383 insertions(+) create mode 100644 include/linux/cmdline.h create mode 100644 lib/generic_cmdline.S create mode 100644 lib/test_cmdline1.c
include/linux/cmdline.h new file +106 -0
@@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CMDLINE_H +#define _LINUX_CMDLINE_H +/* +* +* Copyright (C) 2006,2021. Cisco Systems, Inc. +* +* Generic Append/Prepend cmdline support. +*/ + + +#include <linux/ctype.h> +#include <linux/cache.h> +#include <asm/setup.h> + +#ifdef CONFIG_CMDLINE_BOOL +extern char cmdline_prepend[]; +extern char cmdline_append[]; +extern char cmdline_tmp[]; +#define CMDLINE_PREPEND cmdline_prepend +#define CMDLINE_APPEND cmdline_append +#define CMDLINE_TMP cmdline_tmp +#define CMDLINE_STATIC_PREPEND CONFIG_CMDLINE_PREPEND +#define CMDLINE_STATIC_APPEND CONFIG_CMDLINE_APPEND +#else +#define CMDLINE_PREPEND "" +#define CMDLINE_APPEND "" +#define CMDLINE_TMP "" +#define CMDLINE_STATIC_PREPEND "" +#define CMDLINE_STATIC_APPEND "" +#endif + +#ifndef CMDLINE_STRLCAT +#define CMDLINE_STRLCAT strlcat +#endif + +#ifndef CMDLINE_STRLEN +#define CMDLINE_STRLEN strlen +#endif + +/* +* This function will append or prepend a builtin command line to the command +* line provided by the bootloader. Kconfig options can be used to alter +* the behavior of this builtin command line. +* @dest: The destination of the final appended/prepended string +* @tmp: temporary space used for prepending +* @prepend: string to prepend to @dest +* @append: string to append to @dest +* @length: the maximum length of the strings above. +* @cmdline_strlen: point to a compatible strlen +* @cmdline_strlcat: point to a compatible strlcat +* This function returns true when the builtin command line was copied successfully +* and false when there was not enough room to copy all parts of the command line. +*/ +static inline bool +__cmdline_add_builtin ( +char *dest, +char *tmp, +char *prepend, +char *append, +unsigned long length, +size_t (*cmdline_strlen)(const char *s), +size_t (*cmdline_strlcat)(char *dest,const char *src,size_t count)) +{ +size_t total_length =0 , tmp_length; + +if (!IS_ENABLED (CONFIG_GENERIC_CMDLINE )) +return true; + +if (!IS_ENABLED (CONFIG_CMDLINE_BOOL )) +return true; + +if (IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) + dest[0 ] ='\0' ; +else + total_length +=cmdline_strlen (dest); + + tmp_length =cmdline_strlen (append); +if (tmp_length >0 ) { +cmdline_strlcat (dest, append, length); + total_length += tmp_length; + } + + tmp_length =cmdline_strlen (prepend); +if (tmp_length >0 ) { +cmdline_strlcat (tmp, prepend, length); +cmdline_strlcat (tmp, dest, length); + dest[0 ] ='\0' ; +cmdline_strlcat (dest, tmp, length); + total_length += tmp_length; + } + + tmp[0 ] ='\0' ; + +if (total_length > length) +return false; + +return true; +} + +#define cmdline_add_builtin (dest) \ + __cmdline_add_builtin(dest, CMDLINE_TMP, CMDLINE_PREPEND, CMDLINE_APPEND, COMMAND_LINE_SIZE, CMDLINE_STRLEN, CMDLINE_STRLCAT) + +#define cmdline_get_static_builtin (dest) \ + (CMDLINE_STATIC_PREPEND CMDLINE_STATIC_APPEND) +#endif
init/Kconfig +78 -0
84 lines not on this page · raw message
lib/Kconfig +4 -0
@@ -706,6 +706,10 @@ config PARMAN config OBJAGG tristate "objagg" if COMPILE_TEST +config TEST_CMDLINE + depends on CMDLINE_BOOL && !CMDLINE_OVERRIDE + tristate "Test generic command line handling" + endmenu config GENERIC_IOREMAP
lib/Makefile +3 -0
@@ -416,3 +416,6 @@ $(obj)/$(TEST_FORTIFY_LOG): $(addprefix $(obj)/, $(TEST_FORTIFY_LOGS)) FORCE ifeq ($(CONFIG_FORTIFY_SOURCE),y) $(obj)/string.o: $(obj)/$(TEST_FORTIFY_LOG) endif + +obj-$(CONFIG_TEST_CMDLINE) += test_cmdline1.o +obj-$(CONFIG_CMDLINE_BOOL) += generic_cmdline.o
lib/generic_cmdline.S new file +53 -0
53 lines not on this page · raw message
lib/test_cmdline1.c new file +139 -0
139 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 2/8 scripts: insert-sys-cert: add command line insert capability
In reply to Daniel WalkerThis adds changes to the insert-sys-cert tool to allow updating the cmdline_prepend and cmdline_append symbols in addition to adding certificates.
Updating the cmdline symbols was tested on a PVH virtual machine with a vmlinux, and with a bzImage which was repackaged on x86.
This commit intentionally keeps the tool filename the same to allow the changes to be seen more easily. The next commit will change the name of the tool.
--- scripts/insert-sys-cert.c | 241 +++++++++++++++++++++++++++----------- 1 file changed, 170 insertions(+), 71 deletions(-)
scripts/insert-sys-cert.c +170 -71
@@ -30,6 +30,9 @@#define USED_SYM "system_extra_cert_used"#define LSIZE_SYM "system_certificate_list_size" +#define CMDLINE_APPEND "cmdline_append" +#define CMDLINE_PREPEND "cmdline_prepend" + #define info(format, args...) fprintf(stderr, "INFO: " format, ## args) #define warn(format, args...) fprintf(stdout, "WARNING: " format, ## args) #define err(format, args...) fprintf(stderr, "ERROR: " format, ## args)
@@ -267,95 +270,46 @@ static void print_sym(Elf_Ehdr *hdr, struct sym *s)static void print_usage (char *e) { -printf ("Usage %s [-s <System.map>] -b <vmlinux> -c <certfile>\n" , e); +printf ("Usage %s [-s <System.map>] -b <vmlinux> [ -c <certfile> | -p <command line prepend> | -a <command line append> ]-\n" , e); } -int main (int argc,char **argv) +static char *cmdline_prepend, *cmdline_append; +static char *system_map_file; +static char *cert_file; +static char *cli_name; + +static int insert_certificate (Elf_Ehdr *hdr) { -char *system_map_file =NULL ; -char *vmlinux_file =NULL ; -char *cert_file =NULL ; -int vmlinux_size; +struct sym cert_sym, lsize_sym, used_sym; +Elf_Shdr *symtab =NULL ; +unsigned long *lsize; +FILE *system_map;int cert_size; -Elf_Ehdr *hdr;char *cert; -FILE *system_map; -unsigned long *lsize;int *used; -int opt; -Elf_Shdr *symtab =NULL ; -struct sym cert_sym, lsize_sym, used_sym; - -while ((opt =getopt (argc, argv,"b:c:s:" )) !=-1 ) { -switch (opt) { -case 's' : - system_map_file = optarg; -break ; -case 'b' : - vmlinux_file = optarg; -break ; -case 'c' : - cert_file = optarg; -break ; -default : -break ; - } - } -if (!vmlinux_file || !cert_file) { -print_usage (argv[0 ]); -exit (EXIT_FAILURE ); +if (!cert_file) { +print_usage (cli_name); +return EXIT_FAILURE ; } cert =read_file (cert_file, &cert_size);if (!cert) -exit (EXIT_FAILURE ); - - hdr =map_file (vmlinux_file, &vmlinux_size); -if (!hdr) -exit (EXIT_FAILURE ); - -if (vmlinux_size <sizeof (*hdr)) { -err ("Invalid ELF file.\n" ); -exit (EXIT_FAILURE ); - } - -if ((hdr->e_ident[EI_MAG0 ] !=ELFMAG0 ) || - (hdr->e_ident[EI_MAG1 ] !=ELFMAG1 ) || - (hdr->e_ident[EI_MAG2 ] !=ELFMAG2 ) || - (hdr->e_ident[EI_MAG3 ] !=ELFMAG3 )) { -err ("Invalid ELF magic.\n" ); -exit (EXIT_FAILURE ); - } - -if (hdr->e_ident[EI_CLASS ] !=CURRENT_ELFCLASS ) { -err ("ELF class mismatch.\n" ); -exit (EXIT_FAILURE ); - } - -if (hdr->e_ident[EI_DATA ] !=endianness ()) { -err ("ELF endian mismatch.\n" ); -exit (EXIT_FAILURE ); - } - -if (hdr->e_shoff > vmlinux_size) { -err ("Could not find section header.\n" ); -exit (EXIT_FAILURE ); - } +return EXIT_FAILURE ; symtab =get_symbol_table (hdr);if (!symtab) {warn ("Could not find the symbol table.\n" );if (!system_map_file) {err ("Please provide a System.map file.\n" ); -print_usage (argv[0 ]); -exit (EXIT_FAILURE ); +print_usage (cli_name); +return EXIT_FAILURE ; } system_map =fopen (system_map_file,"r" );if (!system_map) {perror (system_map_file); -exit (EXIT_FAILURE ); +return EXIT_FAILURE ; }get_symbol_from_map (hdr, system_map,CERT_SYM , &cert_sym);get_symbol_from_map (hdr, system_map,USED_SYM , &used_sym);
@@ -371,7 +325,7 @@ int main(int argc, char **argv) }if (!cert_sym.offset || !lsize_sym.offset || !used_sym.offset) -exit (EXIT_FAILURE ); +return EXIT_FAILURE ;print_sym (hdr, &cert_sym);print_sym (hdr, &used_sym);
@@ -382,14 +336,14 @@ int main(int argc, char **argv)if (cert_sym.size < cert_size) {err ("Certificate is larger than the reserved area!\n" ); -exit (EXIT_FAILURE ); +return EXIT_FAILURE ; }/* If the existing cert is the same, don't overwrite */ if (cert_size == *used &&strncmp (cert_sym.content, cert, cert_size) ==0 ) {warn ("Certificate was already inserted.\n" ); -exit (EXIT_SUCCESS ); +return EXIT_SUCCESS ; }if (*used >0 )
@@ -406,5 +360,150 @@ int main(int argc, char **argv) cert_sym.address);info ("Used %d bytes out of %d bytes reserved.\n" , *used, cert_sym.size); -exit (EXIT_SUCCESS ); +return EXIT_SUCCESS ; +} + +static int insert_cmdline (Elf_Ehdr *hdr) +{ +struct sym cmdline_prepend_sym, cmdline_append_sym; +Elf_Shdr *symtab =NULL ; +FILE *system_map; + + symtab =get_symbol_table (hdr); +if (!symtab) { +warn ("Could not find the symbol table.\n" ); +if (!system_map_file) { +err ("Please provide a System.map file.\n" ); +print_usage (cli_name); +return EXIT_FAILURE ; + } + + system_map =fopen (system_map_file,"r" ); +if (!system_map) { +perror (system_map_file); +return EXIT_FAILURE ; + } +get_symbol_from_map (hdr, system_map,CMDLINE_PREPEND , &cmdline_prepend_sym); +get_symbol_from_map (hdr, system_map,CMDLINE_APPEND , &cmdline_append_sym); + }else { +info ("Symbol table found.\n" ); +if (system_map_file) +warn ("System.map is ignored.\n" ); +get_symbol_from_table (hdr, symtab,CMDLINE_PREPEND , &cmdline_prepend_sym); +get_symbol_from_table (hdr, symtab,CMDLINE_APPEND , &cmdline_append_sym); + } + +print_sym (hdr, &cmdline_prepend_sym); +print_sym (hdr, &cmdline_append_sym); + + +if (cmdline_prepend) { +if ((strlen (cmdline_prepend) +1 ) > cmdline_prepend_sym.size) { +err ("cmdline prepend is larger than the reserved area!\n" ); +return EXIT_FAILURE ; + } + +memcpy (cmdline_prepend_sym.content, cmdline_prepend,strlen (cmdline_prepend) +1 ); +if ((strlen (cmdline_prepend) +1 ) < cmdline_prepend_sym.size) +memset (cmdline_prepend_sym.content +strlen (cmdline_prepend) +1 , +0 , cmdline_prepend_sym.size - (strlen (cmdline_prepend) +1 )); + +info ("Inserted cmdline prepend of \"%s\" into vmlinux.\n" , cmdline_prepend); + + } +if (cmdline_append) { +if ((strlen (cmdline_append) +1 ) > cmdline_append_sym.size) { +err ("cmdline append is larger than the reserved area!\n" ); +return EXIT_FAILURE ; + } + +memcpy (cmdline_append_sym.content, cmdline_append,strlen (cmdline_append) +1 ); +if ((strlen (cmdline_append) +1 ) < cmdline_append_sym.size) +memset (cmdline_append_sym.content +strlen (cmdline_append) +1 , +0 , cmdline_append_sym.size - (strlen (cmdline_append) +1 )); + +info ("Inserted cmdline append of \"%s\" into vmlinux.\n" , cmdline_append); + + } +return EXIT_SUCCESS ; +} + +int main (int argc,char **argv) +{ +char *vmlinux_file =NULL ; +int vmlinux_size; +Elf_Ehdr *hdr; +int opt; +int ret =EXIT_SUCCESS ; + +while ((opt =getopt (argc, argv,"b:c:s:p:a:" )) !=-1 ) { +switch (opt) { +case 's' : + system_map_file = optarg; +break ; +case 'b' : + vmlinux_file = optarg; +break ; +case 'c' : + cert_file = optarg; +break ; +case 'p' : + cmdline_prepend = optarg; +break ; +case 'a' : + cmdline_append = optarg; +break ; +default : +break ; + } + } + + cli_name = argv[0 ]; + +if (!vmlinux_file) { +print_usage (cli_name); +exit (EXIT_FAILURE ); + } + + hdr =map_file (vmlinux_file, &vmlinux_size); +if (!hdr) +exit (EXIT_FAILURE ); + +if (vmlinux_size <sizeof (*hdr)) { +err ("Invalid ELF file.\n" ); +exit (EXIT_FAILURE ); + } + +if ((hdr->e_ident[EI_MAG0 ] !=ELFMAG0 ) || + (hdr->e_ident[EI_MAG1 ] !=ELFMAG1 ) || + (hdr->e_ident[EI_MAG2 ] !=ELFMAG2 ) || + (hdr->e_ident[EI_MAG3 ] !=ELFMAG3 )) { +err ("Invalid ELF magic.\n" ); +exit (EXIT_FAILURE ); + } + +if (hdr->e_ident[EI_CLASS ] !=CURRENT_ELFCLASS ) { +err ("ELF class mismatch.\n" ); +exit (EXIT_FAILURE ); + } + +if (hdr->e_ident[EI_DATA ] !=endianness ()) { +err ("ELF endian mismatch.\n" ); +exit (EXIT_FAILURE ); + } + +if (hdr->e_shoff > vmlinux_size) { +err ("Could not find section header.\n" ); +exit (EXIT_FAILURE ); + } + +if (cert_file) { + ret =insert_certificate (hdr); +printf ("%s\n" , cert_file); + } + +if (cmdline_append || cmdline_prepend) + ret =insert_cmdline (hdr); + +exit (ret); }
Signature · 1 line
2.25.1
PATCH 3/8 scripts: insert-sys-cert: change name to insert-symbol
In reply to Daniel WalkerSince the tool is used to update the command line and/or to update the certificates, I think it makes sense to changes the name of this tool.
Update the name of the tool to better reflect it's new use.
---
scripts/Makefile | 2 +-
scripts/{insert-sys-cert.c => insert-symbol.c} | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
rename scripts/{insert-sys-cert.c => insert-symbol.c} (99%)scripts/Makefile +1 -1
@@ -9,7 +9,7 @@ hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable hostprogs-always-$(CONFIG_ASN1) += asn1_compiler hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file -hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert +hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-symbol HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include HOSTLDLIBS_sorttable = -lpthread
scripts/insert-symbol.c renamed from scripts/insert-sys-cert.c +1 -1
@@ -7,7 +7,7 @@* This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * -* Usage: insert-sys-cert [-s <System.map> -b <vmlinux> -c <certfile> +* Usage: insert-symbol [-s <System.map> -b <vmlinux> -c <certfile> */ #define _GNU_SOURCE
Signature · 1 line
2.25.1
PATCH 4/8 CMDLINE: mips: convert to generic builtin command line
In reply to Daniel WalkerThis updates the mips code to use the CONFIG_GENERIC_CMDLINE option.
This deletes the option for MIPS_CMDLINE_BUILTIN_EXTEND and replaces the functionality with generic code.
Of note, the pic32 has some strange handling of the current built in command line. It was converted to use the static variant which can't be updated after compilation. It should eventually be updated to use to append and prepend symbols.
This includes a scripted mass convert of the config files to use the new generic cmdline. There is a bit of a trim effect here. It would seems that some of the config haven't been trimmed in a while.
The script used is as follows,
if [[ -z "$1" || -z "$2" ]]; then
echo "Two arguments are needed."
exit 1
fi
mkdir $1
cp $2 $1/.config
sed -i 's/CONFIG_CMDLINE=/CONFIG_CMDLINE_BOOL=y\nCONFIG_CMDLINE_PREPEND=/g' $1/.config make ARCH=$1 O=$1 olddefconfig
make ARCH=$1 O=$1 savedefconfig
cp $1/defconfig $2
rm -Rf $1
--- arch/mips/Kconfig | 4 +-- arch/mips/Kconfig.debug | 44 ----------------------- arch/mips/configs/ar7_defconfig | 9 ++--- arch/mips/configs/bcm47xx_defconfig | 8 ++--- arch/mips/configs/bcm63xx_defconfig | 15 +++----- arch/mips/configs/bmips_be_defconfig | 11 +++--- arch/mips/configs/bmips_stb_defconfig | 6 ++-- arch/mips/configs/ci20_defconfig | 9 +++-- arch/mips/configs/cu1000-neo_defconfig | 10 +++--- arch/mips/configs/cu1830-neo_defconfig | 10 +++--- arch/mips/configs/generic_defconfig | 6 ++-- arch/mips/configs/gpr_defconfig | 18 ++-------- arch/mips/configs/loongson3_defconfig | 12 +++---- arch/mips/include/asm/setup.h | 2 ++ arch/mips/kernel/relocate.c | 17 +++++++-- arch/mips/kernel/setup.c | 36 +++---------------- arch/mips/pic32/pic32mzda/early_console.c | 2 +- arch/mips/pic32/pic32mzda/init.c | 3 +- 18 files changed, 64 insertions(+), 158 deletions(-)
arch/mips/Kconfig +1 -3
@@ -31,6 +31,7 @@ config MIPS select CPU_NO_EFFICIENT_FFS if (TARGET_ISA_REV < 1) select CPU_PM if CPU_IDLE select GENERIC_ATOMIC64 if !64BIT + select GENERIC_CMDLINE select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_GETTIMEOFDAY
@@ -3084,9 +3085,6 @@ choice config MIPS_CMDLINE_FROM_BOOTLOADER bool "Bootloader kernel arguments if available" - config MIPS_CMDLINE_BUILTIN_EXTEND - depends on CMDLINE_BOOL - bool "Extend builtin kernel arguments with bootloader arguments" endchoice endmenu
arch/mips/Kconfig.debug +0 -44
50 lines not on this page · raw message
arch/mips/configs/ar7_defconfig +2 -7
@@ -12,6 +12,8 @@ CONFIG_EXPERT=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="rootfstype=squashfs,jffs2" CONFIG_AR7=y CONFIG_HZ_100=y CONFIG_KEXEC=y
@@ -32,9 +34,6 @@ CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_MROUTE=y CONFIG_SYN_COOKIES=y -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_INET_DIAG is not set CONFIG_TCP_CONG_ADVANCED=y # CONFIG_TCP_CONG_BIC is not set
@@ -43,7 +42,6 @@ CONFIG_TCP_CONG_WESTWOOD=y # CONFIG_TCP_CONG_HTCP is not set # CONFIG_IPV6 is not set CONFIG_NETFILTER=y -# CONFIG_BRIDGE_NETFILTER is not set CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK_MARK=y CONFIG_NF_CONNTRACK_FTP=m
@@ -117,8 +115,5 @@ CONFIG_JFFS2_SUMMARY=y CONFIG_JFFS2_COMPRESSION_OPTIONS=y CONFIG_SQUASHFS=y # CONFIG_CRYPTO_HW is not set -# CONFIG_ENABLE_MUST_CHECK is not set CONFIG_STRIP_ASM_SYMS=y CONFIG_DEBUG_FS=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
arch/mips/configs/bcm47xx_defconfig +4 -4
@@ -4,8 +4,9 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_EMBEDDED=y CONFIG_SLAB=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="console=ttyS0,115200" CONFIG_BCM47XX=y -CONFIG_PCI=y # CONFIG_SUSPEND is not set CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y
@@ -32,6 +33,7 @@ CONFIG_NET_SCH_FQ_CODEL=y CONFIG_HAMRADIO=y CONFIG_CFG80211=y CONFIG_MAC80211=y +CONFIG_PCI=y CONFIG_MTD=y CONFIG_MTD_BCM47XX_PARTS=y CONFIG_MTD_BLOCK=y
@@ -75,7 +77,5 @@ CONFIG_PRINTK_TIME=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_INFO_REDUCED=y CONFIG_STRIP_ASM_SYMS=y -CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="console=ttyS0,115200" +CONFIG_DEBUG_FS=y
arch/mips/configs/bcm63xx_defconfig +5 -10
@@ -11,27 +11,26 @@ CONFIG_EXPERT=y # CONFIG_AIO is not set # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="console=ttyS0,115200" CONFIG_BCM63XX=y CONFIG_BCM63XX_CPU_6338=y CONFIG_BCM63XX_CPU_6345=y CONFIG_BCM63XX_CPU_6348=y CONFIG_BCM63XX_CPU_6358=y # CONFIG_SECCOMP is not set -CONFIG_PCI=y -CONFIG_PCCARD=y -CONFIG_PCMCIA_BCM63XX=y # CONFIG_BLK_DEV_BSG is not set CONFIG_NET=y CONFIG_UNIX=y CONFIG_INET=y -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_INET_DIAG is not set # CONFIG_IPV6 is not set CONFIG_CFG80211=y CONFIG_NL80211_TESTMODE=y CONFIG_MAC80211=y +CONFIG_PCI=y +CONFIG_PCCARD=y +CONFIG_PCMCIA_BCM63XX=y # CONFIG_STANDALONE is not set # CONFIG_PREVENT_FIRMWARE_BUILD is not set CONFIG_MTD=y
@@ -50,8 +49,6 @@ CONFIG_B43=y # CONFIG_SERIO is not set # CONFIG_VT is not set # CONFIG_UNIX98_PTYS is not set -CONFIG_SERIAL_BCM63XX=y -CONFIG_SERIAL_BCM63XX_CONSOLE=y # CONFIG_HW_RANDOM is not set # CONFIG_HWMON is not set # CONFIG_VGA_ARB is not set
@@ -65,5 +62,3 @@ CONFIG_PROC_KCORE=y # CONFIG_NETWORK_FILESYSTEMS is not set # CONFIG_CRYPTO_HW is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="console=ttyS0,115200"
arch/mips/configs/bmips_be_defconfig +4 -7
@@ -5,21 +5,20 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_EXPERT=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon" CONFIG_BMIPS_GENERIC=y CONFIG_HIGHMEM=y CONFIG_SMP=y CONFIG_NR_CPUS=4 -# CONFIG_SECCOMP is not set CONFIG_MIPS_O32_FP64_SUPPORT=y +# CONFIG_SECCOMP is not set # CONFIG_BLK_DEV_BSG is not set CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_DIAG=y CONFIG_UNIX=y CONFIG_INET=y -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_INET_DIAG is not set CONFIG_CFG80211=y CONFIG_NL80211_TESTMODE=y
@@ -73,7 +72,5 @@ CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=y # CONFIG_CRYPTO_HW is not set CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="earlycon" +CONFIG_DEBUG_FS=y
arch/mips/configs/bmips_stb_defconfig +3 -3
@@ -6,6 +6,8 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_EXPERT=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon" CONFIG_BMIPS_GENERIC=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_HIGHMEM=y
@@ -38,15 +40,13 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y CONFIG_BMIPS_CPUFREQ=y +# CONFIG_SECCOMP is not set # CONFIG_BLK_DEV_BSG is not set CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_DIAG=y CONFIG_UNIX=y CONFIG_INET=y -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_INET_DIAG is not set CONFIG_CFG80211=y CONFIG_NL80211_TESTMODE=y
arch/mips/configs/ci20_defconfig +4 -5
@@ -22,12 +22,14 @@ CONFIG_EMBEDDED=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon console=ttyS4,115200 clk_ignore_unused" CONFIG_MACH_INGENIC_SOC=y CONFIG_JZ4780_CI20=y CONFIG_HIGHMEM=y CONFIG_HZ_100=y -# CONFIG_SECCOMP is not set # CONFIG_SUSPEND is not set +# CONFIG_SECCOMP is not set CONFIG_MODULES=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_COMPACTION is not set
@@ -111,6 +113,7 @@ CONFIG_USB_STORAGE=y CONFIG_USB_DWC2=y CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_CH341=y +CONFIG_JZ4770_PHY=y CONFIG_USB_GADGET=y CONFIG_MMC=y CONFIG_MMC_JZ4740=y
@@ -144,7 +147,6 @@ CONFIG_JZ4780_NEMC=y CONFIG_PWM=y CONFIG_PWM_JZ4740=m CONFIG_JZ4780_EFUSE=y -CONFIG_JZ4770_PHY=y CONFIG_EXT4_FS=y # CONFIG_DNOTIFY is not set CONFIG_AUTOFS_FS=y
@@ -157,7 +159,6 @@ CONFIG_CONFIGFS_FS=y CONFIG_UBIFS_FS=y CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y -CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_737=y CONFIG_NLS_CODEPAGE_775=y
@@ -209,5 +210,3 @@ CONFIG_PANIC_TIMEOUT=10 # CONFIG_DEBUG_PREEMPT is not set CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="earlycon console=ttyS4,115200 clk_ignore_unused"
arch/mips/configs/cu1000-neo_defconfig +4 -6
@@ -19,12 +19,14 @@ CONFIG_EMBEDDED=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon clk_ignore_unused" CONFIG_MACH_INGENIC_SOC=y CONFIG_X1000_CU1000_NEO=y CONFIG_HIGHMEM=y CONFIG_HZ_100=y -# CONFIG_SECCOMP is not set # CONFIG_SUSPEND is not set +# CONFIG_SECCOMP is not set CONFIG_MODULES=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_COMPACTION is not set
@@ -67,12 +69,12 @@ CONFIG_SENSORS_ADS7828=m CONFIG_WATCHDOG=y CONFIG_JZ4740_WDT=y # CONFIG_VGA_CONSOLE is not set -# CONFIG_HID is not set CONFIG_USB=y CONFIG_USB_STORAGE=y CONFIG_USB_DWC2=y CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_CH341=y +CONFIG_JZ4770_PHY=y CONFIG_USB_GADGET=y CONFIG_MMC=y CONFIG_MMC_JZ4740=y
@@ -87,7 +89,6 @@ CONFIG_DMA_JZ4780=y # CONFIG_INGENIC_TIMER is not set CONFIG_INGENIC_SYSOST=y # CONFIG_IOMMU_SUPPORT is not set -CONFIG_JZ4770_PHY=y CONFIG_EXT4_FS=y # CONFIG_DNOTIFY is not set CONFIG_AUTOFS_FS=y
@@ -98,7 +99,6 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_CONFIGFS_FS=y CONFIG_NFS_FS=y -CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_936=y CONFIG_NLS_CODEPAGE_950=y
@@ -123,5 +123,3 @@ CONFIG_PANIC_TIMEOUT=10 # CONFIG_DEBUG_PREEMPT is not set CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="earlycon clk_ignore_unused"
arch/mips/configs/cu1830-neo_defconfig +4 -6
@@ -19,12 +19,14 @@ CONFIG_EMBEDDED=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_COMPAT_BRK is not set CONFIG_SLAB=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon clk_ignore_unused" CONFIG_MACH_INGENIC_SOC=y CONFIG_X1830_CU1830_NEO=y CONFIG_HIGHMEM=y CONFIG_HZ_100=y -# CONFIG_SECCOMP is not set # CONFIG_SUSPEND is not set +# CONFIG_SECCOMP is not set CONFIG_MODULES=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set # CONFIG_COMPACTION is not set
@@ -70,12 +72,12 @@ CONFIG_SENSORS_ADS7828=m CONFIG_WATCHDOG=y CONFIG_JZ4740_WDT=y # CONFIG_VGA_CONSOLE is not set -# CONFIG_HID is not set CONFIG_USB=y CONFIG_USB_STORAGE=y CONFIG_USB_DWC2=y CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_CH341=y +CONFIG_JZ4770_PHY=y CONFIG_USB_GADGET=y CONFIG_MMC=y CONFIG_MMC_JZ4740=y
@@ -90,7 +92,6 @@ CONFIG_DMA_JZ4780=y # CONFIG_INGENIC_TIMER is not set CONFIG_INGENIC_SYSOST=y # CONFIG_IOMMU_SUPPORT is not set -CONFIG_JZ4770_PHY=y CONFIG_EXT4_FS=y # CONFIG_DNOTIFY is not set CONFIG_AUTOFS_FS=y
@@ -101,7 +102,6 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_CONFIGFS_FS=y CONFIG_NFS_FS=y -CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_936=y CONFIG_NLS_CODEPAGE_950=y
@@ -126,5 +126,3 @@ CONFIG_PANIC_TIMEOUT=10 # CONFIG_DEBUG_PREEMPT is not set CONFIG_STACKTRACE=y # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="earlycon clk_ignore_unused"
arch/mips/configs/generic_defconfig +2 -4
@@ -3,7 +3,6 @@ CONFIG_NO_HZ_IDLE=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_MEMCG=y -CONFIG_MEMCG_SWAP=y CONFIG_BLK_CGROUP=y CONFIG_CFS_BANDWIDTH=y CONFIG_RT_GROUP_SCHED=y
@@ -21,6 +20,8 @@ CONFIG_USERFAULTFD=y CONFIG_EMBEDDED=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="earlycon" CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_MIPS_CPS=y CONFIG_HIGHMEM=y
@@ -52,7 +53,6 @@ CONFIG_HID_CHICONY=y CONFIG_HID_CYPRESS=y CONFIG_HID_EZKEY=y CONFIG_HID_KENSINGTON=y -CONFIG_HID_LOGITECH=y CONFIG_HID_MICROSOFT=y CONFIG_HID_MONTEREY=y # CONFIG_MIPS_PLATFORM_DEVICES is not set
@@ -88,5 +88,3 @@ CONFIG_DEBUG_INFO_REDUCED=y CONFIG_DEBUG_FS=y # CONFIG_SCHED_DEBUG is not set # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="earlycon"
arch/mips/configs/gpr_defconfig +3 -15
@@ -10,9 +10,10 @@ CONFIG_BLK_DEV_INITRD=y CONFIG_EXPERT=y CONFIG_SLAB=y CONFIG_PROFILING=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="console=ttyS0,115200 root=/dev/nfs rw ip=auto" CONFIG_MIPS_ALCHEMY=y CONFIG_MIPS_GPR=y -CONFIG_PCI=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_PARTITION_ADVANCED=y
@@ -29,9 +30,6 @@ CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_SYN_COOKIES=y -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set # CONFIG_IPV6 is not set CONFIG_NETWORK_SECMARK=y CONFIG_NETFILTER=y
@@ -49,7 +47,6 @@ CONFIG_NETFILTER_XT_MATCH_LIMIT=m CONFIG_NETFILTER_XT_MATCH_MAC=m CONFIG_NETFILTER_XT_MATCH_MARK=m CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m CONFIG_NETFILTER_XT_MATCH_QUOTA=m CONFIG_NETFILTER_XT_MATCH_REALM=m
@@ -151,6 +148,7 @@ CONFIG_BAYCOM_SER_HDX=m CONFIG_YAM=m CONFIG_CFG80211=y CONFIG_MAC80211=y +CONFIG_PCI=y CONFIG_MTD=y CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y
@@ -220,9 +218,6 @@ CONFIG_HDLC_X25=m CONFIG_PCI200SYN=m CONFIG_WANXL=m CONFIG_FARSYNC=m -CONFIG_DSCC4=m -CONFIG_DSCC4_PCISYNC=y -CONFIG_DSCC4_PCI_RST=y CONFIG_LAPBETHER=m # CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_MOUSE is not set
@@ -242,7 +237,6 @@ CONFIG_WATCHDOG_NOWAYOUT=y CONFIG_SSB=m CONFIG_SSB_DRIVER_PCICORE=y # CONFIG_VGA_ARB is not set -# CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=y # CONFIG_VGA_CONSOLE is not set CONFIG_USB_HID=m
@@ -290,16 +284,10 @@ CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_WP512=m -CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m -CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_SERPENT=m -CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_DEFLATE=m -# CONFIG_ENABLE_MUST_CHECK is not set CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw ip=auto"
arch/mips/configs/loongson3_defconfig +5 -7
@@ -5,6 +5,8 @@ CONFIG_POSIX_MQUEUE=y CONFIG_AUDIT=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y +CONFIG_BPF_SYSCALL=y +CONFIG_BPF_JIT=y CONFIG_PREEMPT=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y
@@ -25,9 +27,10 @@ CONFIG_SCHED_AUTOGROUP=y CONFIG_SYSFS_DEPRECATED=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y -CONFIG_BPF_SYSCALL=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE_PREPEND="ieee754=relaxed" CONFIG_MACH_LOONGSON64=y CONFIG_CPU_HAS_MSA=y CONFIG_NUMA=y
@@ -128,7 +131,6 @@ CONFIG_L2TP=m CONFIG_BRIDGE=m CONFIG_VSOCKETS=m CONFIG_VIRTIO_VSOCKETS=m -CONFIG_BPF_JIT=y CONFIG_CFG80211=m CONFIG_CFG80211_WEXT=y CONFIG_MAC80211=m
@@ -143,7 +145,6 @@ CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_MTD=m CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_CRYPTOLOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_VIRTIO_BLK=y
@@ -197,7 +198,6 @@ CONFIG_VIRTIO_NET=m # CONFIG_NET_VENDOR_ARC is not set # CONFIG_NET_VENDOR_ATHEROS is not set # CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_BROCADE is not set # CONFIG_NET_VENDOR_CHELSIO is not set # CONFIG_NET_VENDOR_CIRRUS is not set # CONFIG_NET_VENDOR_CISCO is not set
@@ -218,6 +218,7 @@ CONFIG_IXGBE=y # CONFIG_NET_VENDOR_NVIDIA is not set # CONFIG_NET_VENDOR_OKI is not set # CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_BROCADE is not set # CONFIG_NET_VENDOR_RDC is not set CONFIG_8139CP=m CONFIG_8139TOO=m
@@ -268,7 +269,6 @@ CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_NONSTANDARD=y CONFIG_VIRTIO_CONSOLE=y CONFIG_HW_RANDOM=y -CONFIG_RAW_DRIVER=m CONFIG_I2C_CHARDEV=y CONFIG_I2C_PIIX4=y CONFIG_GPIO_LOONGSON=y
@@ -404,5 +404,3 @@ CONFIG_DEBUG_FS=y # CONFIG_DEBUG_PREEMPT is not set CONFIG_FUNCTION_TRACER=y CONFIG_FTRACE_SYSCALLS=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="ieee754=relaxed"
arch/mips/include/asm/setup.h +2 -0
@@ -5,6 +5,7 @@#include <linux/types.h> #include <uapi/asm/setup.h> +#ifndef __ASSEMBLY__extern void prom_putchar (char );extern void setup_early_printk (void );
@@ -27,5 +28,6 @@ extern unsigned long ebase;extern unsigned int hwrena;extern void per_cpu_trap_init (bool );extern void cpu_cache_init (void ); +#endif #endif /* __SETUP_H */
arch/mips/kernel/relocate.c +14 -3
@@ -23,6 +23,7 @@#include <linux/start_kernel.h> #include <linux/string.h> #include <linux/printk.h> +#include <linux/cmdline.h> #define RELOCATED (x) ((void *)((long)x + offset))
@@ -247,16 +248,26 @@ static inline __init bool kaslr_disabled(void)char *str;#if defined(CONFIG_CMDLINE_BOOL ) -const char *builtin_cmdline =CONFIG_CMDLINE ; +char *builtin_cmdline =CMDLINE_PREPEND ; str =strstr (builtin_cmdline,"nokaslr" );if (str == builtin_cmdline || (str > builtin_cmdline && *(str -1 ) ==' ' ))return true;#endif - str =strstr (arcs_cmdline,"nokaslr" ); -if (str == arcs_cmdline || (str > arcs_cmdline && *(str -1 ) ==' ' )) +if (!IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) { + str =strstr (arcs_cmdline,"nokaslr" ); +if (str == arcs_cmdline || (str > arcs_cmdline && *(str -1 ) ==' ' )) +return true; + } + +#if defined(CONFIG_CMDLINE_BOOL ) + builtin_cmdline =CMDLINE_APPEND ; + str =strstr (builtin_cmdline,"nokaslr" ); +if (str == builtin_cmdline || + (str > builtin_cmdline && *(str -1 ) ==' ' ))return true; +#endif return false; }
arch/mips/kernel/setup.c +4 -32
@@ -23,6 +23,7 @@#include <linux/debugfs.h> #include <linux/kexec.h> #include <linux/sizes.h> +#include <linux/cmdline.h> #include <linux/device.h> #include <linux/dma-map-ops.h> #include <linux/decompress/generic.h>
@@ -67,12 +68,6 @@ EXPORT_SYMBOL(mips_machtype);static char __initdata command_line[COMMAND_LINE_SIZE ];char __initdata arcs_cmdline[COMMAND_LINE_SIZE ]; -#ifdef CONFIG_CMDLINE_BOOL -static const char builtin_cmdline[]__initconst =CONFIG_CMDLINE ; -#else -static const char builtin_cmdline[]__initconst ="" ; -#endif -/* * mips_io_port_base is the begin of the address space to which x86 style * I/O ports are mapped.
@@ -557,27 +552,7 @@ static void __init bootcmdline_init(void) {bool dt_bootargs = false; -/* -* If CMDLINE_OVERRIDE is enabled then initializing the command line is -* trivial - we simply use the built-in command line unconditionally & -* unmodified. -*/ -if (IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) { -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); -return ; - } - -/* -* If the user specified a built-in command line & -* MIPS_CMDLINE_BUILTIN_EXTEND, then the built-in command line is -* prepended to arguments from the bootloader or DT so we'll copy them -* to the start of boot_command_line here. Otherwise, empty -* boot_command_line to undo anything early_init_dt_scan_chosen() did. -*/ -if (IS_ENABLED (CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND )) -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); -else - boot_command_line[0 ] =0 ; + boot_command_line[0 ] =0 ;#ifdef CONFIG_OF_EARLY_FLATTREE /*
@@ -600,12 +575,9 @@ static void __init bootcmdline_init(void)bootcmdline_append (arcs_cmdline,COMMAND_LINE_SIZE );/* -* If the user specified a built-in command line & we didn't already -* prepend it, we append it to boot_command_line here. +* Use the generic system for builtin prepend and append. */ -if (IS_ENABLED (CONFIG_CMDLINE_BOOL ) && - !IS_ENABLED (CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND )) -bootcmdline_append (builtin_cmdline,COMMAND_LINE_SIZE ); +cmdline_add_builtin (boot_command_line); }/*
arch/mips/pic32/pic32mzda/early_console.c +1 -1
@@ -76,7 +76,7 @@ static char * __init pic32_getcmdline(void)* command line setup if using CONFIG_CMDLINE_BOOL. */ #ifdef CONFIG_CMDLINE_OVERRIDE -return CONFIG_CMDLINE ; +return CMDLINE_STATIC_PREPEND " " CMDLINE_STATIC_APPEND ;#else return fw_getcmdline ();#endif
arch/mips/pic32/pic32mzda/init.c +2 -1
@@ -9,6 +9,7 @@#include <linux/of_fdt.h> #include <linux/of_platform.h> #include <linux/platform_data/sdhci-pic32.h> +#include <linux/cmdline.h> #include <asm/fw/fw.h> #include <asm/mips-boards/generic.h>
@@ -41,7 +42,7 @@ void __init plat_mem_setup(void)pr_info (" boot_command_line: %s\n" , boot_command_line);pr_info (" arcs_cmdline : %s\n" , arcs_cmdline);#ifdef CONFIG_CMDLINE_BOOL -pr_info (" builtin_cmdline : %s\n" ,CONFIG_CMDLINE ); +pr_info (" builtin_cmdline : %s\n" ,CMDLINE_STATIC_PREPEND " " CMDLINE_STATIC_APPEND );#endif if (dtb != __dtb_start)strlcpy (arcs_cmdline, boot_command_line,COMMAND_LINE_SIZE );
Signature · 1 line
2.25.1
PATCH 5/8 drivers: firmware: efi: libstub: enable generic commandline
In reply to Daniel WalkerThis adds code to handle the generic command line changes. The efi code appears that it doesn't benefit as much from this design as it could.
For example, if you had a prepend command line with "nokaslr" then you might be helpful to re-enable it in the boot loader or dts, but there appears to be no way to re-enable kaslr or some of the other options.
The efi command line handling is incorrect. x86 and arm have an append system however the efi code prepends the command line.
For example, you could have a non-upgradable bios which sends
efi=disable_early_pci_dma
This hypothetically could have been set because early pci dma caused issues on early versions of the product.
Then later the early pci dma was made to work and the company desired to start using it. To override the bios you could set the CONFIG_CMDLINE to,
efi=no_disable_early_pci_dma
then parsing would normally start with the bios command line, then move to the CONFIG_CMDLINE and you would end up with early pci dma turned on.
however, current efi code keeps early pci dma off because the bios arguments always override the built in.
Per my reading this is different from the main body of x86, arm, and arm64.
The generic command line provides both append and prepend, so it alleviates this issue if it's used. However not all architectures use it.
It would be desirable to allow the efi stub to have it's builtin command line to be modified after compile, but I don't see a feasible way to do that currently.
--- .../firmware/efi/libstub/efi-stub-helper.c | 29 +++++++++++++++++++ drivers/firmware/efi/libstub/efi-stub.c | 9 ++++++ drivers/firmware/efi/libstub/efistub.h | 1 + drivers/firmware/efi/libstub/x86-stub.c | 13 +++++++-- 4 files changed, 50 insertions(+), 2 deletions(-)
drivers/firmware/efi/libstub/efi-stub-helper.c +29 -0
@@ -13,6 +13,7 @@#include <linux/efi.h> #include <linux/kernel.h> #include <linux/printk.h> /* For CONSOLE_LOGLEVEL_* */ +#include <linux/cmdline.h> #include <asm/efi.h> #include <asm/setup.h>
@@ -172,6 +173,34 @@ int efi_printk(const char *fmt, ...)return printed; } +/** +* efi_handle_cmdline() - handle adding in building parts of the command line +* @cmdline: kernel command line +* +* Add in the generic parts of the commandline and start the parsing of the +* command line. +* +* Return: status code +*/ +efi_status_t efi_handle_cmdline (char const *cmdline) +{ +efi_status_t status =EFI_SUCCESS ; + +if (sizeof (CMDLINE_STATIC_PREPEND ) >1 ) + status |=efi_parse_options (CMDLINE_STATIC_PREPEND ); + +if (!IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) + status |=efi_parse_options (cmdline); + +if (sizeof (CMDLINE_STATIC_APPEND ) >1 ) + status |=efi_parse_options (CMDLINE_STATIC_APPEND ); + +if (status !=EFI_SUCCESS ) +efi_err ("Failed to parse options\n" ); + +return status; +} +/** * efi_parse_options() - Parse EFI command line options * @cmdline: kernel command line
drivers/firmware/efi/libstub/efi-stub.c +9 -0
@@ -173,6 +173,14 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, goto fail; } +#ifdef CONFIG_GENERIC_CMDLINE + status =efi_handle_cmdline (cmdline_ptr); +if (status !=EFI_SUCCESS ) { + goto fail_free_cmdline; + } +#endif + +#ifdef CONFIG_CMDLINE if (IS_ENABLED (CONFIG_CMDLINE_EXTEND ) ||IS_ENABLED (CONFIG_CMDLINE_FORCE ) || cmdline_size ==0 ) {
@@ -190,6 +198,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, goto fail_free_cmdline; } } +#endif efi_info ("Booting Linux Kernel...\n" );
drivers/firmware/efi/libstub/efistub.h +1 -0
@@ -907,6 +907,7 @@ efi_status_t efi_relocate_kernel(unsigned long *image_addr,unsigned long alignment, unsigned long min_addr); +efi_status_t efi_handle_cmdline (char const *cmdline);efi_status_t efi_parse_options (char const *cmdline);void efi_parse_option_graphics (char *option);
drivers/firmware/efi/libstub/x86-stub.c +11 -2
@@ -783,6 +783,8 @@ unsigned long efi_main(efi_handle_t handle,unsigned long buffer_start, buffer_end;struct setup_header *hdr = &boot_params->hdr;unsigned long addr, size; +unsigned long cmdline_paddr = ((u64 )hdr->cmd_line_ptr | + ((u64 )boot_params->ext_cmd_line_ptr <<32 ));efi_status_t status; efi_system_table = sys_table_arg;
@@ -851,6 +853,14 @@ unsigned long efi_main(efi_handle_t handle, image_offset =0 ; } +#ifdef CONFIG_GENERIC_CMDLINE + status = efi_handle_cmdline((char *)cmdline_paddr); + if (status != EFI_SUCCESS) { + efi_err("Failed to parse options\n"); + goto fail; + } +#else /* CONFIG_GENERIC_CMDLINE */ + #ifdef CONFIG_CMDLINE_BOOL status = efi_parse_options(CONFIG_CMDLINE); if (status != EFI_SUCCESS) {
@@ -859,8 +869,6 @@ unsigned long efi_main(efi_handle_t handle, }#endif if (!IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) { -unsigned long cmdline_paddr = ((u64 )hdr->cmd_line_ptr | - ((u64 )boot_params->ext_cmd_line_ptr <<32 )); status =efi_parse_options ((char *)cmdline_paddr);if (status !=EFI_SUCCESS ) {efi_err ("Failed to parse options\n" );
@@ -868,6 +876,7 @@ unsigned long efi_main(efi_handle_t handle, } } +#endif /* * At this point, an initrd may already have been loaded by the * bootloader and passed via bootparams. We permit an initrd loaded
Signature · 1 line
2.25.1
PATCH 6/8 CMDLINE: x86: convert to generic builtin command line
In reply to Daniel WalkerThis updates the x86 code to use the CONFIG_GENERIC_CMDLINE option.
--- arch/x86/Kconfig | 44 +---------------------------------------- arch/x86/kernel/setup.c | 18 ++--------------- 2 files changed, 3 insertions(+), 59 deletions(-)
arch/x86/Kconfig +1 -43
@@ -134,6 +134,7 @@ config X86 select EDAC_SUPPORT select GENERIC_CLOCKEVENTS_BROADCAST if X86_64 || (X86_32 && X86_LOCAL_APIC) select GENERIC_CLOCKEVENTS_MIN_ADJUST + select GENERIC_CMDLINE select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_CPU_VULNERABILITIES
@@ -2342,49 +2343,6 @@ choice endchoice -config CMDLINE_BOOL - bool "Built-in kernel command line" - help - Allow for specifying boot arguments to the kernel at - build time. On some systems (e.g. embedded ones), it is - necessary or convenient to provide some or all of the - kernel boot arguments with the kernel itself (that is, - to not rely on the boot loader to provide them.) - - To compile command line arguments into the kernel, - set this option to 'Y', then fill in the - boot arguments in CONFIG_CMDLINE. - - Systems with fully functional boot loaders (i.e. non-embedded) - should leave this option set to 'N'. - -config CMDLINE - string "Built-in kernel command string" - depends on CMDLINE_BOOL - default "" - help - Enter arguments here that should be compiled into the kernel - image and used at boot time. If the boot loader provides a - command line at boot time, it is appended to this string to - form the full kernel command line, when the system boots. - - However, you can use the CONFIG_CMDLINE_OVERRIDE option to - change this behavior. - - In most cases, the command line (whether built-in or provided - by the boot loader) should specify the device for the root - file system. - -config CMDLINE_OVERRIDE - bool "Built-in command line overrides boot loader arguments" - depends on CMDLINE_BOOL && CMDLINE != "" - help - Set this option to 'Y' to have the kernel ignore the boot loader - command line, and use ONLY the built-in command line. - - This is used to work around broken boot loaders. This should - be set to 'N' under normal conditions. - config MODIFY_LDT_SYSCALL bool "Enable the LDT (local descriptor table)" if EXPERT default y
arch/x86/kernel/setup.c +2 -16
@@ -53,6 +53,7 @@#include <asm/unwind.h> #include <asm/vsyscall.h> #include <linux/vmalloc.h> +#include <linux/cmdline.h> /* * max_low_pfn_mapped: highest directly mapped pfn < 4 GB
@@ -167,9 +168,6 @@ unsigned long saved_video_mode;#define RAMDISK_LOAD_FLAG 0x4000static char __initdata command_line[COMMAND_LINE_SIZE ]; -#ifdef CONFIG_CMDLINE_BOOL -static char __initdata builtin_cmdline[COMMAND_LINE_SIZE ] =CONFIG_CMDLINE ; -#endif #if defined(CONFIG_EDD ) || defined(CONFIG_EDD_MODULE )struct edd edd;
@@ -969,19 +967,7 @@ void __init setup_arch(char **cmdline_p) bss_resource.start =__pa_symbol (__bss_start); bss_resource.end =__pa_symbol (__bss_stop)-1 ; -#ifdef CONFIG_CMDLINE_BOOL -#ifdef CONFIG_CMDLINE_OVERRIDE -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); -#else -if (builtin_cmdline[0 ]) { -/* append boot loader cmdline to builtin */ -strlcat (builtin_cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (builtin_cmdline, boot_command_line,COMMAND_LINE_SIZE ); -strscpy (boot_command_line, builtin_cmdline,COMMAND_LINE_SIZE ); - } -#endif -#endif - +cmdline_add_builtin (boot_command_line);strscpy (command_line, boot_command_line,COMMAND_LINE_SIZE ); *cmdline_p = command_line;
Signature · 1 line
2.25.1
PATCH 7/8 of: replace command line handling
In reply to Daniel WalkerRob Herring has complained about this section of code. I removed the command line handling code to the cmdline.h header. This hopefully makes it easier for Rob to maintain it (at least he doesn't have to look at it directly anymore). I would like to add a Kconfig option called OF_DEPRECATED_CMDLINE which an architecture would set if it uses this code. This would allow a platform to use the cmdline.h and the added function directly and remove the Kconfig option. This change would be in a subsequent patch.
This code was boot tested on powerpc 32bit, powerpc 64bit without any generic command line conversion.
--- drivers/of/fdt.c | 22 ++-------------------- include/linux/cmdline.h | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 21 deletions(-)
drivers/of/fdt.c +2 -20
@@ -27,6 +27,7 @@#include <linux/sysfs.h> #include <linux/random.h> #include <linux/kmemleak.h> +#include <linux/cmdline.h> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ #include <asm/page.h>
@@ -1177,26 +1178,7 @@ int __init early_init_dt_scan_chosen(char *cmdline)/* Retrieve command line */ p =of_get_flat_dt_prop (node,"bootargs" , &l); -if (p !=NULL && l >0 ) -strlcpy (cmdline, p,min (l,COMMAND_LINE_SIZE )); - -/* -* CONFIG_CMDLINE is meant to be a default in case nothing else -* managed to set the command line, unless CONFIG_CMDLINE_FORCE -* is set in which case we override whatever was found earlier. -*/ -#ifdef CONFIG_CMDLINE -#if defined(CONFIG_CMDLINE_EXTEND ) -strlcat (cmdline," " ,COMMAND_LINE_SIZE ); -strlcat (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); -#elif defined(CONFIG_CMDLINE_FORCE ) -strlcpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); -#else -/* No arguments from boot loader, use kernel's cmdl*/ -if (!((char *)cmdline)[0 ]) -strlcpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); -#endif -#endif /* CONFIG_CMDLINE */ +of_deprecated_cmdline_update (cmdline, p, l);pr_debug ("Command line is: %s\n" , (char *)cmdline);
include/linux/cmdline.h +32 -1
@@ -103,4 +103,35 @@ __cmdline_add_builtin(#define cmdline_get_static_builtin (dest) \ (CMDLINE_STATIC_PREPEND CMDLINE_STATIC_APPEND) -#endif + +#ifndef CONFIG_GENERIC_CMDLINE +static inline bool of_deprecated_cmdline_update (char *cmdline,const char *dt_bootargs,int length) +{ +if (dt_bootargs !=NULL && length >0 ) +strlcpy (cmdline, dt_bootargs,min (length,COMMAND_LINE_SIZE )); +/* +* CONFIG_CMDLINE is meant to be a default in case nothing else +* managed to set the command line, unless CONFIG_CMDLINE_FORCE +* is set in which case we override whatever was found earlier. +*/ +#ifdef CONFIG_CMDLINE +#if defined(CONFIG_CMDLINE_EXTEND ) +strlcat (cmdline," " ,COMMAND_LINE_SIZE ); +strlcat (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); +#elif defined(CONFIG_CMDLINE_FORCE ) +strlcpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); +#else +/* No arguments from boot loader, use kernel's cmdl*/ +if (!((char *)cmdline)[0 ]) +strlcpy (cmdline,CONFIG_CMDLINE ,COMMAND_LINE_SIZE ); +#endif /* CONFIG_CMDLINE_EXTEND */ +#endif /* CONFIG_CMDLINE */ + +return true; +} +#else +static inline bool of_deprecated_cmdline_update (char *cmdline,const char *dt_bootargs,int length) {return false; } +#endif /* CONFIG_GENERIC_CMDLINE */ + + +#endif /* _LINUX_CMDLINE_H */
Signature · 1 line
2.25.1
PATCH 8/8 CMDLINE: arm64: convert to generic builtin command line
In reply to Daniel WalkerThis removes arm64 from the device tree handling of the command line arguments.
The boot_command_line variable is populated inside the earliest user of the command line, which is in idreg-override.c.
The device tree should not be needed to do any further handling of the boot command line options.
--- arch/arm64/Kconfig | 33 +---------------------------- arch/arm64/include/asm/setup.h | 4 ++++ arch/arm64/include/uapi/asm/setup.h | 2 ++ arch/arm64/kernel/idreg-override.c | 9 ++++---- arch/arm64/kernel/pi/kaslr_early.c | 14 ++++++------ 5 files changed, 19 insertions(+), 43 deletions(-)
arch/arm64/Kconfig +1 -32
@@ -123,6 +123,7 @@ config ARM64 select GENERIC_ALLOCATOR select GENERIC_ARCH_TOPOLOGY select GENERIC_CLOCKEVENTS_BROADCAST + select GENERIC_CMDLINE select GENERIC_CPU_AUTOPROBE select GENERIC_CPU_VULNERABILITIES select GENERIC_EARLY_IOREMAP
@@ -2137,38 +2138,6 @@ config ARM64_ACPI_PARKING_PROTOCOL protocol even if the corresponding data is present in the ACPI MADT table. -config CMDLINE - string "Default kernel command string" - default "" - help - Provide a set of default command-line options at build time by - entering them here. As a minimum, you should specify the the - root device (e.g. root=/dev/nfs). - -choice - prompt "Kernel command line type" if CMDLINE != "" - default CMDLINE_FROM_BOOTLOADER - help - Choose how the kernel will handle the provided default kernel - command line string. - -config CMDLINE_FROM_BOOTLOADER - bool "Use bootloader kernel arguments if available" - help - Uses the command-line options passed by the boot loader. If - the boot loader doesn't provide any, the default kernel command - string provided in CMDLINE will be used. - -config CMDLINE_FORCE - bool "Always use the default kernel command string" - help - Always use the default kernel command string, even if the boot - loader passes other arguments to the kernel. - This is useful if you cannot or don't want to change the - command-line options your boot loader passes to the kernel. - -endchoice - config EFI_STUB bool
arch/arm64/include/asm/setup.h +4 -0
@@ -3,10 +3,13 @@#ifndef __ARM64_ASM_SETUP_H#define __ARM64_ASM_SETUP_H +#ifndef __ASSEMBLY__#include <linux/string.h> +#endif #include <uapi/asm/setup.h> +#ifndef __ASSEMBLY__void *get_early_fdt_ptr (void );void early_fdt_map (u64 dt_phys);
@@ -30,5 +33,6 @@ static inline bool arch_parse_debug_rodata(char *arg)return false; }#define arch_parse_debug_rodata arch_parse_debug_rodata +#endif /* __ASSEMBLY__ */ #endif
arch/arm64/include/uapi/asm/setup.h +2 -0
@@ -20,7 +20,9 @@#ifndef __ASM_SETUP_H#define __ASM_SETUP_H +#ifndef __ASSEMBLY__#include <linux/types.h> +#endif #define COMMAND_LINE_SIZE 2048
arch/arm64/kernel/idreg-override.c +5 -4
@@ -9,6 +9,7 @@#include <linux/ctype.h> #include <linux/kernel.h> #include <linux/libfdt.h> +#include <linux/cmdline.h> #include <asm/cacheflush.h> #include <asm/cpufeature.h>
@@ -287,11 +288,11 @@ static __init void parse_cmdline(void) {const u8 *prop =get_bootargs_cmdline (); -if (IS_ENABLED (CONFIG_CMDLINE_FORCE ) || !prop) -__parse_cmdline (CONFIG_CMDLINE , true); +strscpy (boot_command_line, prop,COMMAND_LINE_SIZE ); +cmdline_add_builtin (boot_command_line); + +__parse_cmdline (boot_command_line, true); -if (!IS_ENABLED (CONFIG_CMDLINE_FORCE ) && prop) -__parse_cmdline (prop, true); }/* Keep checkers quiet */
arch/arm64/kernel/pi/kaslr_early.c +7 -7
@@ -11,6 +11,7 @@#include <linux/types.h> #include <linux/sizes.h> #include <linux/string.h> +#include <linux/cmdline.h> #include <asm/archrandom.h> #include <asm/memory.h>
@@ -42,7 +43,7 @@ static bool cmdline_contains_nokaslr(const u8 *cmdline)static bool is_kaslr_disabled_cmdline (void *fdt) { -if (!IS_ENABLED (CONFIG_CMDLINE_FORCE )) { +if (!IS_ENABLED (CONFIG_CMDLINE_OVERRIDE )) {int node;const u8 *prop;
@@ -54,16 +55,15 @@ static bool is_kaslr_disabled_cmdline(void *fdt)if (!prop) goto out; +if (cmdline_contains_nokaslr (CMDLINE_STATIC_APPEND )) +return true;if (cmdline_contains_nokaslr (prop))return true; - -if (IS_ENABLED (CONFIG_CMDLINE_EXTEND )) - goto out; - -return false; +if (cmdline_contains_nokaslr (CMDLINE_STATIC_PREPEND )) +return true; } out: -return cmdline_contains_nokaslr (CONFIG_CMDLINE ); +return cmdline_contains_nokaslr (cmdline_get_static_builtin ()); }static u64 get_kaslr_seed (void *fdt)
Signature · 1 line
2.25.1
Quoted 74 lines · Daniel Walker
v5 release changes. Generally a rebase from v4.
* Modified OF changes to move the ugly code into the
cmdline.h* Minor compliation update in arm64. Added ifndef
__ASSEMBLY__in a few places.* Worked around arm64
kaslr_early.c.This code needs some additional review and consideration. It appears this code is missing the opposite option to nokaslr which is kaslr.disabled=1/0 which would allow kaslr to be turn back on later in the command line. For example,
console=ttyS0 nokaslr root=/dev/ram0 nosmp kaslr.disabled=0 loglevel=7
On arm64 in
arch/arm64/kernel/idreg-override.cthis is parsed correctly to turn on kaslr, but thekaslr_early.cis missing this logic. Doing this results in kaslr getting disabled with the following message,KASLR disabled due to lack of seed
Even when there is a seed in the device tree.
So change to the generic command line would leave built in command lines with nokaslr with no option to re-enable kaslr in in the bootloader arguments.
Daniel Walker (8):
CMDLINE: add generic builtin command line
scripts: insert-sys-cert: add command line insert capability
scripts: insert-sys-cert: change name to insert-symbol
CMDLINE: mips: convert to generic builtin command line
drivers: firmware: efi: libstub: enable generic commandline
CMDLINE: x86: convert to generic builtin command line
of: replace command line handling
CMDLINE: arm64: convert to generic builtin command linearch/arm64/Kconfig | 33 +-- arch/arm64/include/asm/setup.h | 4 + arch/arm64/include/uapi/asm/setup.h | 2 + arch/arm64/kernel/idreg-override.c | 9 +- arch/arm64/kernel/pi/kaslr_early.c | 14 +- arch/mips/Kconfig | 4 +- arch/mips/Kconfig.debug | 44 ---- arch/mips/configs/ar7_defconfig | 9 +- arch/mips/configs/bcm47xx_defconfig | 8 +- arch/mips/configs/bcm63xx_defconfig | 15 +- arch/mips/configs/bmips_be_defconfig | 11 +- arch/mips/configs/bmips_stb_defconfig | 6 +- arch/mips/configs/ci20_defconfig | 9 +- arch/mips/configs/cu1000-neo_defconfig | 10 +- arch/mips/configs/cu1830-neo_defconfig | 10 +- arch/mips/configs/generic_defconfig | 6 +- arch/mips/configs/gpr_defconfig | 18 +- arch/mips/configs/loongson3_defconfig | 12 +- arch/mips/include/asm/setup.h | 2 + arch/mips/kernel/relocate.c | 17 +- arch/mips/kernel/setup.c | 36 +-- arch/mips/pic32/pic32mzda/early_console.c | 2 +- arch/mips/pic32/pic32mzda/init.c | 3 +- arch/x86/Kconfig | 44 +--- arch/x86/kernel/setup.c | 18 +- .../firmware/efi/libstub/efi-stub-helper.c | 29 +++ drivers/firmware/efi/libstub/efi-stub.c | 9 + drivers/firmware/efi/libstub/efistub.h | 1 + drivers/firmware/efi/libstub/x86-stub.c | 13 +- drivers/of/fdt.c | 22 +- include/linux/cmdline.h | 137 ++++++++++ init/Kconfig | 78 ++++++ lib/Kconfig | 4 + lib/Makefile | 3 + lib/generic_cmdline.S | 53 ++++
Quoted 9 lines
lib/test_cmdline1.c | 139 ++++++++++
scripts/Makefile | 2 +-
.../{insert-sys-cert.c => insert-symbol.c} | 243 ++++++++++++------
38 files changed, 724 insertions(+), 355 deletions(-)
create mode 100644 include/linux/cmdline.h
create mode 100644 lib/generic_cmdline.S
create mode 100644 lib/test_cmdline1.c
rename scripts/{insert-sys-cert.c => insert-symbol.c} (72%)For arm64:
Thanks!