Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4570771pxf; Tue, 30 Mar 2021 10:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIhAgUax6TDDi7opTgvwky4xhQFbdebNAHqZGE18zlrC1WLxfwkroTKlRRwAEXeMpMlni1 X-Received: by 2002:a17:907:2112:: with SMTP id qn18mr33734793ejb.220.1617127140340; Tue, 30 Mar 2021 10:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617127140; cv=none; d=google.com; s=arc-20160816; b=MLh2tf53MwNcg9l+MrZuOlWo9+m4ZofNHWr3WrBQzeI4C5ECfsiPtH3H/lV1QZ1nh/ 39Zzdh0cjLl19UFeHYm8YXGEjU5l5aGen3Q9jIovzYLf1JPT1sWwBecD9sBRDkZY2Wit x9kzpHsQhEa1HJzA2uNkBpni108qFkOdQKn04zlFB+OzbKo1s7nOuWPz0inKvp4+3hW5 eeFBui0PvoRmBQMgV5v9J2O2WoU80XMK1CTvd5LV1+vomFYIUTwkilbPhM8xOlCenf+S SI6dqTyqUjW0DKOyfaTnDZPRpP1fENyMhiQqbEERzHrQc1L1p3ghk+vz+g5pJQaj8nJA DeEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-hdrordr:dkim-signature; bh=GT5CDvlLn0ADbMVfIKfzkPWMs1rTLAaJSgCMTowx+M4=; b=PxRK7JsZ+jzxwArfdQbjihoYP2F4KT187DxCTkiVb8OtR1ds8Yb9th/2biKTyj1yZg 9vFYXJn/fzHCvHgemKqnIIQ1a1diVBy0yZxxWOVbegvDO5cBY2D71qxstvFY/TkDSCak sn3BtK0KnEHfofPFqEWqHNFKeov/uvpv4QqpD+pyY/tcwmovH+JbtM8u9Ludv4+aS8IS CNczC220rYpMqnksdFKY6a/uESvuZhw95uQtEOzINAU/VD6TlvZ04VuswUtf9aplwmsT 8BoxwDNN4pqJGb/nY8IhRc1/u4Nv2oiI56DglSwwhjaqgJ4QCryAXFa4ij4iQlecUOba o9QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cisco.com header.s=iport header.b=cU0PAWuc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b67si16256705edf.490.2021.03.30.10.58.37; Tue, 30 Mar 2021 10:59:00 -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; dkim=pass header.i=@cisco.com header.s=iport header.b=cU0PAWuc; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cisco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232650AbhC3R5o (ORCPT + 99 others); Tue, 30 Mar 2021 13:57:44 -0400 Received: from alln-iport-7.cisco.com ([173.37.142.94]:57167 "EHLO alln-iport-7.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232655AbhC3R5X (ORCPT ); Tue, 30 Mar 2021 13:57:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4151; q=dns/txt; s=iport; t=1617127043; x=1618336643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EjJugBDCAD3rUkTSbtxc1b6KQ4ZbfCBpeFGgVbm8wnQ=; b=cU0PAWuc0h+/8LXKj3aJ3ZIenfE87PjfR7JDZDhjhit2mlrzthpv1Q79 p1Pi4KIcqpycgoeRPR14Pji/KA6Glf5XTZh43chbzenIX+VBIBUun4oJo 1Dt6prSiWs7x733DTkDJIA1y+hR/HfCxIatb6y7SCPsyCt/IzkX7Qrkm/ I=; X-IPAS-Result: =?us-ascii?q?A0ABAACmZWNgmJldJa1aGgEBAQEBAQEBAQEDAQEBARIBA?= =?us-ascii?q?QEBAgIBAQEBgXwFAQEBAQsBg3YBOTGMZYksii6QOIF8CwEBAQ80BAEBhFACg?= =?us-ascii?q?XoCJTQJDgIDAQEBAwIDAQEBAQEFAQEBAgEGBBQBAQEBAQEBAYZDhkUDAzIBO?= =?us-ascii?q?A4QUSE2BgESgnCCVgMvqzKCKYgbDWOBRBSBJQGIY3SDciYcgUlCgRIzgyeCH?= =?us-ascii?q?ogYBIJGAXUZAQolAYFUgRuQS4Jxik2bR1uDEYEjlhOFMiKkUpUHjnSUQIFUO?= =?us-ascii?q?IFbMxoIGxWDJFAZDY4rDQmNagFbIQMvOAIGCgEBAwmJHwEB?= IronPort-HdrOrdr: A9a23:PcVGDqAnpbaMxZHlHejxsceALOonbusQ8zAX/mp6ICY4TuWzkc eykPMHkSLugDEKV3063fyGMq+MQXTTnKQFhbU5EL++UGDd1leAA5pl6eLZqQHIOyq7zeJF0L clTq4WMqySMXFfreLXpDa1CMwhxt7vytHMuc77w212RQ9nL4Fshj0ZNi+hHkd7RBZLCPMCff L22uN9qzWtYngRZMigb0N1PdTrncHBl57tfHc9aCIP1Q/mt16VwY+/OwSE2FMkXylXx7A5/S z+jxXh/am4qZiAu3jh/l6Wy5xXndf7o+EiOOW8zu4INz7rlgGkIKNmVrHqhkFNnMifrHA3jd LLvxAse/5W1kqUVGS0rRzxsjOQtgoT1w== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.81,291,1610409600"; d="scan'208";a="670280382" Received: from rcdn-core-2.cisco.com ([173.37.93.153]) by alln-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 30 Mar 2021 17:57:22 +0000 Received: from zorba.cisco.com ([10.24.8.123]) by rcdn-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id 12UHv6CK024502; Tue, 30 Mar 2021 17:57:20 GMT From: Daniel Walker To: Will Deacon , Christophe Leroy , ob Herring , Daniel Gimpelevich , Andrew Morton , x86@kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Cc: xe-linux-external@cisco.com, Ruslan Ruslichenko , Ruslan Bilovol , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] CMDLINE: x86: convert to generic builtin command line Date: Tue, 30 Mar 2021 10:57:02 -0700 Message-Id: <19776ce76932e1957faa21250f303481db39fb32.1617126961.git.danielwa@cisco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com> References: <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-SMTP-Client: 10.24.8.123, [10.24.8.123] X-Outbound-Node: rcdn-core-2.cisco.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 2792879d398e..73ea9589e50d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -118,6 +118,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 +2359,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 d883176ef2ce..6444a5f1fabf 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -47,6 +47,7 @@ #include #include #include +#include /* * max_low_pfn_mapped: highest directly mapped pfn < 4 GB @@ -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,19 +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_OVERRIDE - 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_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE); strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; -- 2.25.1