From patchwork Fri Nov 10 01:38:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel Walker (danielwa)" X-Patchwork-Id: 13451997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B713C4332F for ; Fri, 10 Nov 2023 01:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345735AbjKJBjr (ORCPT ); Thu, 9 Nov 2023 20:39:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345698AbjKJBjg (ORCPT ); Thu, 9 Nov 2023 20:39:36 -0500 Received: from rcdn-iport-4.cisco.com (rcdn-iport-4.cisco.com [173.37.86.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A55224680; Thu, 9 Nov 2023 17:39:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4126; q=dns/txt; s=iport; t=1699580374; x=1700789974; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XQfpZaDuXlcOMYdjdqSlNlugSI0rTVR45ET5BA9fTo8=; b=U88hdUtjrnxYdsaSgei2Bhb+Io4WpBXJPr/M40BdQ4iu0W8VUH8slsQ4 jfrXwc63w0xUyJNPmbPnNXbhz+XdR8DbAGvi3ZjiUdh/LqOy4MERVjjWP qWFQV0y1kI5une0La9ZnUcNZIQAgp66V66choAePSeNfsSOQ0ZnE1kNsQ o=; X-CSE-ConnectionGUID: opm4U75yQ5qWqlXpJd47ng== X-CSE-MsgGUID: keBfZVW7R96+J9PTUrvyaw== X-IPAS-Result: A0ANAADbh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R8+/KcQF5OMhyX4BGx35MrWL7JN dwJ4ZZMgyTm00JCGo/f3kh8qT/WRlReCPpPi33vKNKx4ubd4gscMcW05+6fyMznVuigxWFze W/M2Pqd1+gMrqcAGlJqfUXwMSNmrcxmkHh3IJUqfjxlRvKtaicL4SBs IronPort-HdrOrdr: A9a23:Q6j4cqM5yUMLHMBcTvqjsMiBIKoaSvp037Dk7SxMoHtuA6ilfq +V8sjzuSWftN9VYgBCpTniAtjkfZqjz/9ICOAqVN/IYOClghrLEGgI1+TfKlPbdhEW39Qtsp uIC5IfNDU1ZmIK9PoTJ2KDYrAd/OU= X-Talos-CUID: 9a23:SrpMfG37Hfq4oOBx6DfY/rxfHdggLkCCkWbpflaHEGJZUJ+ZFQCW9/Yx X-Talos-MUID: 9a23:9KHXXQuRrMWoa/bens2nhzxIOvVW3PuUWR5Os8Q+h/SeKz15JGLI X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.03,291,1694736000"; d="scan'208";a="134982790" Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by rcdn-iport-4.cisco.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2023 01:38:32 +0000 Received: from goliath.lan ([10.25.128.169]) by rcdn-core-4.cisco.com (8.15.2/8.15.2) with ESMTP id 3AA1cHVM011466; Fri, 10 Nov 2023 01:38:30 GMT From: Daniel Walker To: Will Deacon , Christophe Leroy , Rob Herring , Daniel Gimpelevich , Andrew Morton , Pratyush Brahma , Tomas Mudrunka , Sean Anderson , x86@kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: xe-linux-external@cisco.com, Ruslan Ruslichenko , Ruslan Bilovol , linux-kernel@vger.kernel.org Subject: [PATCH 6/8] CMDLINE: x86: convert to generic builtin command line Date: Thu, 9 Nov 2023 17:38:10 -0800 Message-Id: <20231110013817.2378507-7-danielwa@cisco.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231110013817.2378507-1-danielwa@cisco.com> References: <20231110013817.2378507-1-danielwa@cisco.com> MIME-Version: 1.0 X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.25.128.169, [10.25.128.169] X-Outbound-Node: rcdn-core-4.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org This updates the x86 code to use the CONFIG_GENERIC_CMDLINE option. Cc: xe-linux-external@cisco.com Signed-off-by: Ruslan Ruslichenko Signed-off-by: Ruslan Bilovol Signed-off-by: Daniel Walker --- arch/x86/Kconfig | 44 +---------------------------------------- arch/x86/kernel/setup.c | 18 ++--------------- 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 66bfabae8814..390ffaa743df 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -145,6 +145,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 @@ -2309,49 +2310,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 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index b098b1fa2470..bd025c003f32 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -55,6 +55,7 @@ #include #include #include +#include /* * max_low_pfn_mapped: highest directly mapped pfn < 4 GB @@ -162,9 +163,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; @@ -959,19 +957,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;