Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1358041pxf; Fri, 2 Apr 2021 08:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWU9oAgfzpYhRy9IzG3PgbQlOse6D6WGUwixecUQjD9qrbDJDC2+l4Dp/Iel+fqynEQ5XP X-Received: by 2002:a17:906:405b:: with SMTP id y27mr14855174ejj.332.1617376909326; Fri, 02 Apr 2021 08:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617376909; cv=none; d=google.com; s=arc-20160816; b=nSjZHiXZCGobmuB+00CQTBI4KuPgf3ATuDDw/J9UYRM9slLZ2Ztp5NamSgs2tRtAxj r2wK3TF/tmEJTYc0U4Evkhyc+Wrj3ulCyivt4NfUmx65eUCe3i+0OYb5g8AHX9oAdFIa QvkE6yv9o11jXUUKKE7IGQ3T9voVLYLXDq5XVOMbLd7DtZnbGI3egPBf5dlVmtxuKeeq A9o7E6HsPLHK0ORObw+2TIqgjcxvQ5SODHto0zvVORg/np7eemtkyyzy/29UAhJw3Wf1 YRPFx+O+2B3oJDcvzA/GR0pPLxr1i8CdrTGoSRDhzl4k4FKKqrCzeQV4bAkYptImDOLs pW0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=DvzbYWET/9PCzR+QkzKT/bLi05RHTjcWKKcAuBoCMcs=; b=GOYv+sAWy+hlsDV9iMicxdNN/tWZwoKScy3vn35499nC0b/pI4sb+UAjRf6mWwFw7t G46L/fQ+8aJb4a6yJHovMu7P7uXE6qEUKMXYGg4/XGfvuvoK6x6V1eulIZUWGLCSiJsM FlQ9k/Pb5B7Ca9QSSDacZtmvJFj3hJg8msk6FxTqqjZv+lZiUGtxbpUysUbA75CMx0y+ 5FQxKov4u1Y1LC8/EZma/GTofwcSoJvyXcgFoAs5L+EpsjOxUn4cccAw92blhxErmoPT d+9bXmdNpCGP8U8R9INWOnNAB1qrh52HPwVBKTL87gM/y7hCyGtNnNVTkj+Svpy6LZSf XdrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si6841443edv.312.2021.04.02.08.21.26; Fri, 02 Apr 2021 08:21:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236346AbhDBPTQ (ORCPT + 99 others); Fri, 2 Apr 2021 11:19:16 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:38234 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235953AbhDBPS1 (ORCPT ); Fri, 2 Apr 2021 11:18:27 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG32LP9z9v2mF; Fri, 2 Apr 2021 17:18:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id l6-zcpN14Qua; Fri, 2 Apr 2021 17:18:19 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FBkG31Gsmz9v2ls; Fri, 2 Apr 2021 17:18:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1C3F28BB7D; Fri, 2 Apr 2021 17:18:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yvlVdRkNlJmU; Fri, 2 Apr 2021 17:18:20 +0200 (CEST) Received: from po16121vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6DEC28BB82; Fri, 2 Apr 2021 17:18:20 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 45A3267989; Fri, 2 Apr 2021 15:18:20 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 18/20] x86: Convert to GENERIC_CMDLINE To: will@kernel.org, danielwa@cisco.com, robh@kernel.org, daniel@gimpelevich.san-francisco.ca.us, arnd@kernel.org, akpm@linux-foundation.org Cc: linux-arch@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, microblaze , linux-mips@vger.kernel.org, nios2 , openrisc@lists.librecores.org, linux-hexagon@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org Date: Fri, 2 Apr 2021 15:18:20 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/x86/Kconfig | 45 ++--------------------------------------- arch/x86/kernel/setup.c | 17 ++-------------- 2 files changed, 4 insertions(+), 58 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index a20684d56b4b..66b384228ca3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -104,6 +104,7 @@ config X86 select ARCH_USE_QUEUED_SPINLOCKS select ARCH_USE_SYM_ANNOTATIONS select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH + select ARCH_WANT_CMDLINE_PREPEND_BY_DEFAULT select ARCH_WANT_DEFAULT_BPF_JIT if X86_64 select ARCH_WANTS_DYNAMIC_TASK_STRUCT select ARCH_WANT_HUGE_PMD_SHARE @@ -118,6 +119,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 @@ -2358,49 +2360,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_FORCE 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_FORCE - 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 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 6f2de58eeb54..3f274b02e51c 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -5,6 +5,7 @@ * This file contains the setup_arch() code, which handles the architecture-dependent * parts of early kernel initialization. */ +#include #include #include #include @@ -161,9 +162,6 @@ unsigned long saved_video_mode; #define RAMDISK_LOAD_FLAG 0x4000 static 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; @@ -883,18 +881,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_FORCE - strlcpy(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); - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - } -#endif -#endif + cmdline_build(boot_command_line, boot_command_line); strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; -- 2.25.0