From patchwork Fri Apr 2 15:18:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 042DCC43470 for ; Fri, 2 Apr 2021 15:18:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9128F61056 for ; Fri, 2 Apr 2021 15:18:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9128F61056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2iVhn+V9kLqlhVCav9yhWSeQhQMBghk7ADNceMqfiEo=; b=WS6uUDoKWFUA4Mxu7BlSX4Rx19 0CQEK/FPKbeVhWDFJh6qRlHvnHu7G9z5AL7XdC/gJ2KD4Q740HjA+T4sHMQt4tmdjQJ2d2DSEgh/Q UmGQ15JMtHdBx9YnhM4sD6yKcirfzikfFtuQMsLBN7kgJ6gXK0VHBcpp/wwZ8mXdoySVv4vabLC5p 4bMd69VYzoAb/Pp721oWkm3bHwKu0ezRoDC9CC+ZmUglR01wzjpxV89SoF/Bde4gPEP9p83Bm1o+i XtRe8AB1x5OkrzDmQ+kO4R2Uh85IyBEp9ldu4+7QzBJzqY1mnchhgdZ6Hvvte0GnXRQuLgYOrfy2s Ncj61mdg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZS-00DCbU-3d; Fri, 02 Apr 2021 15:18:51 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYl-00DCMM-Rb; Fri, 02 Apr 2021 15:18:10 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFj2vNPz9v2lt; Fri, 2 Apr 2021 17:18:01 +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 NJ34BehnDmHj; Fri, 2 Apr 2021 17:18:01 +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 4FBkFj1ndyz9v2ls; Fri, 2 Apr 2021 17:18:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2774B8BB7C; Fri, 2 Apr 2021 17:18:03 +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 wc8EW3tptikR; Fri, 2 Apr 2021 17:18:03 +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 99C3C8BB7B; Fri, 2 Apr 2021 17:18:02 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 701DA67989; Fri, 2 Apr 2021 15:18:02 +0000 (UTC) Message-Id: <68db4e57bb88c523f76dcae12feafbb0cae1a85d.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 01/20] cmdline: Add generic function to build command line. 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:02 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161808_036211_ECE23D71 X-CRM114-Status: GOOD ( 16.82 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This code provides architectures with a way to build command line based on what is built in the kernel and what is handed over by the bootloader, based on selected compile-time options. Signed-off-by: Christophe Leroy --- v3: - Addressed comments from Will - Added capability to have src == dst v4: - Add cmdline_strlcpy() - Removed cmdline_build() macro, __cmdline_build() becomes cmdline_build() - Fixed the destination length to COMMAND_LINE_SIZE - Truncate at a space not in a quote when too long - Added a message when forcing the command line --- include/linux/cmdline.h | 79 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 include/linux/cmdline.h diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h new file mode 100644 index 000000000000..a0773dc365c7 --- /dev/null +++ b/include/linux/cmdline.h @@ -0,0 +1,79 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CMDLINE_H +#define _LINUX_CMDLINE_H + +#include +#include +#include + +/* Allow users to override strlcat/strlcpy, powerpc can't use strings so early*/ +#ifndef cmdline_strlcat +#define cmdline_strlcat strlcat +#define cmdline_strlcpy strlcpy +#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. + * @dst: The destination of the final command line (Min. size COMMAND_LINE_SIZE) + * @src: The starting string or NULL if there isn't one. Must not equal dst. + * Returns: false if the string was truncated, true otherwise + */ +static __always_inline bool __cmdline_build(char *dst, const char *src) +{ + int len; + char *ptr, *last_space; + bool in_quote = false; + + if (IS_ENABLED(CONFIG_CMDLINE_FORCE)) + src = NULL; + + dst[0] = 0; + + if (IS_ENABLED(CONFIG_CMDLINE_PREPEND)) + len = cmdline_strlcat(dst, CONFIG_CMDLINE " ", COMMAND_LINE_SIZE); + + len = cmdline_strlcat(dst, src, COMMAND_LINE_SIZE); + + if (IS_ENABLED(CONFIG_CMDLINE_EXTEND)) + len = cmdline_strlcat(dst, " " CONFIG_CMDLINE, COMMAND_LINE_SIZE); + + if (len < COMMAND_LINE_SIZE - 1) + return true; + + for (ptr = dst; *ptr; ptr++) { + if (*ptr == '"') + in_quote = !in_quote; + if (*ptr == ' ' && !in_quote) + last_space = ptr; + } + if (last_space) + *last_space = 0; + + return false; +} + +/* + * 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. + * @dst: The destination of the final command line (Min. size COMMAND_LINE_SIZE) + * @src: The starting string or NULL if there isn't one. + */ +static __always_inline void cmdline_build(char *dst, const char *src) +{ + static char tmp[COMMAND_LINE_SIZE] __initdata; + + if (src == dst) { + cmdline_strlcpy(tmp, src, COMMAND_LINE_SIZE); + src = tmp; + } + if (!__cmdline_build(dst, src)) + pr_warn("Command line is too long, it has been truncated\n"); + + if (IS_ENABLED(CONFIG_CMDLINE_FORCE)) + pr_info("Forcing kernel command line to: %s\n", dst); +} + +#endif /* _LINUX_CMDLINE_H */ From patchwork Fri Apr 2 15:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181071 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C37AC4363E for ; Fri, 2 Apr 2021 15:18:35 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6886260FD7 for ; Fri, 2 Apr 2021 15:18:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6886260FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pLvwEk4U3Q5tp+Wy8/jqNF0VQvvTov5ayOnrWh0l1ik=; b=Mog+r+OlRztdOdYJDOpccdbsnu 1S/bZm3reMhrwKdhr6B/28DaI9FTVvE8Lon3nVklqCd/3hxMEsH+1KQUG7stFheUqCKfq0vQQ6nf/ f59EAPkgwpRPfNKlB2E2onlNPEBv+tSPIMjbrl9Tk3o/nc0PxexaPJzmbhbYpVv6h6/0tjlCi7d5n vyze6yceWyNGj8DuRYNp8UhsOKMWDh6AdgtNLSGOngwBvQVvkJ8wjltgSriKWxSmX05bYGgYp4EI6 TEZ6GFvTYA5r2VNfNqi0KZ+Z1CtC1570GeC7cNCGDh/eVIF4bCOGn4YJY2Y2wE6/jOco0OtOphL5U o+813I+Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZ3-00DCVf-KN; Fri, 02 Apr 2021 15:18:25 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYk-00DCMO-GF; Fri, 02 Apr 2021 15:18:08 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFk2Qtfz9v2lw; Fri, 2 Apr 2021 17:18:02 +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 awj2GZXCOGXI; Fri, 2 Apr 2021 17:18:02 +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 4FBkFk1Y3Hz9v2ls; Fri, 2 Apr 2021 17:18:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1EA028BB7B; Fri, 2 Apr 2021 17:18:04 +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 CXPejaJgMc2o; Fri, 2 Apr 2021 17:18:04 +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 9A88B8BB79; Fri, 2 Apr 2021 17:18:03 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7710067989; Fri, 2 Apr 2021 15:18:03 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 02/20] drivers: of: use cmdline building function 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:03 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161806_657626_69CB32AB X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This patch uses the new cmdline building function to concatenate the of provided cmdline with built-in parts based on compile-time options. Signed-off-by: Christophe Leroy --- drivers/of/fdt.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index dcc1dd96911a..7c5e9fb6039b 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -25,6 +25,7 @@ #include #include #include +#include #include /* for COMMAND_LINE_SIZE */ #include @@ -1050,26 +1051,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, /* Retrieve command line */ p = of_get_flat_dt_prop(node, "bootargs", &l); - if (p != NULL && l > 0) - strlcpy(data, p, min(l, COMMAND_LINE_SIZE)); + if (l <= 0) + p = NULL; - /* - * 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(data, " ", COMMAND_LINE_SIZE); - strlcat(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#elif defined(CONFIG_CMDLINE_FORCE) - strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#else - /* No arguments from boot loader, use kernel's cmdl*/ - if (!((char *)data)[0]) - strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#endif -#endif /* CONFIG_CMDLINE */ + cmdline_build(data, p); pr_debug("Command line is: %s\n", (char *)data); From patchwork Fri Apr 2 15:18:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9D40C43603 for ; Fri, 2 Apr 2021 15:19:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4BACA61056 for ; Fri, 2 Apr 2021 15:19:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4BACA61056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d7wHaaoPyRhov7LpDsYoaMIwxGkSjRowZ7BedDj0n3c=; b=At/hA84T8GVIOMPfZsjx62bIiw tClIBrnBxgkd1mlm9DCm4DPYM9mQq24T0MrkLmw6e7wpLYv6oyAvF3gI3L7FfL8h+ymEaIN8KHMMS Z6rMW70G5QJr+8JjuQbtjQ/UQaRvsRPiQ64+O4W9lVSDSctqZkzfC4NF9fqL1mgXHQqRyRh8YdY4Q yrt/ecUM+AT/FjOOwLLuYC08IaJg3EH63FIM+bs8jeAyIEQTQZFgs5idDXi6EVsBkCk1RxhdrtxTP efAxrit6qkjeilalHOUypK4Zm7unNsDhohM0ue3BFuxyloSVBuTGYgEX3RYl9pzJdYPSXVjOrvIFl 14YlWMXQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZc-00DCfF-N9; Fri, 02 Apr 2021 15:19:00 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYm-00DCNe-0Q; Fri, 02 Apr 2021 15:18:10 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFl3Jq5z9v2m1; Fri, 2 Apr 2021 17:18:03 +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 otY6ACZI1rY1; Fri, 2 Apr 2021 17:18:03 +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 4FBkFl2Mpwz9v2ls; Fri, 2 Apr 2021 17:18:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 33C168BB7B; Fri, 2 Apr 2021 17:18:05 +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 j0ftI9D6qL0u; Fri, 2 Apr 2021 17:18:05 +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 A27078BB79; Fri, 2 Apr 2021 17:18:04 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7ECCA67989; Fri, 2 Apr 2021 15:18:04 +0000 (UTC) Message-Id: <76542a49b685ddb41894fd53feb250fcec731b01.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 03/20] x86/efi: Replace CONFIG_CMDLINE_OVERRIDE by CONFIG_CMDLINE_FORCE 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:04 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161808_606665_6FBFB058 X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org During boot, x86 uses EFI driver. That driver is also used by ARM. In order to refactor the command line processing in that driver in a following patch, rename CONFIG_CMDLINE_OVERRIDE by CONFIG_CMDLINE_FORCE on the x86 in order to be similar to ARM (and most other architectures). Signed-off-by: Christophe Leroy --- v4: New --- arch/x86/Kconfig | 4 ++-- arch/x86/kernel/setup.c | 2 +- drivers/firmware/efi/libstub/x86-stub.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 2792879d398e..a20684d56b4b 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2384,14 +2384,14 @@ config CMDLINE 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 + 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_OVERRIDE +config CMDLINE_FORCE bool "Built-in command line overrides boot loader arguments" depends on CMDLINE_BOOL && CMDLINE != "" help diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index d883176ef2ce..6f2de58eeb54 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -884,7 +884,7 @@ void __init setup_arch(char **cmdline_p) bss_resource.end = __pa_symbol(__bss_stop)-1; #ifdef CONFIG_CMDLINE_BOOL -#ifdef CONFIG_CMDLINE_OVERRIDE +#ifdef CONFIG_CMDLINE_FORCE strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); #else if (builtin_cmdline[0]) { diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index f14c4ff5839f..28659276b6ba 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -742,7 +742,7 @@ unsigned long efi_main(efi_handle_t handle, goto fail; } #endif - if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) { + if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) { unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr | ((u64)boot_params->ext_cmd_line_ptr << 32)); status = efi_parse_options((char *)cmdline_paddr); From patchwork Fri Apr 2 15:18:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 095F3C4363C for ; Fri, 2 Apr 2021 15:18:35 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6896E61057 for ; Fri, 2 Apr 2021 15:18:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6896E61057 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ygxxg6voNvkUtfygiaNBz52WJN7ST6UXhZqMLEOjm08=; b=n2CoI7lnxl8bZN0r/b0DeF0dCS Z+OACsth9ZTnpZYaXCVe5qtG8kBngEOF1HeBd5kedq4AY+4Q6vn0xAiYG1d+in3cg/70JjLuigJr8 lGHJqC/5JvcINc2sM5AGF828sGbj0wZvC73luzpQt8LhyvhZjOP5+mR416V2/S8vh3/fg4r174oXP 8nCWMWOzWaNqnDVl2IZ/O6biyGidMYIn2S44eESESbnTPZBmrfCTRWfOh11VRnUkFAwWMkI6O3faT YsXprdKnFU/BFEMpDULGB/VUyEOsc/xeUYd3HW6om6iXT6QhmX2qPo5G19t6WCBqhGrLsgP8hIuQA mj09M7ig==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZ5-00DCW7-J2; Fri, 02 Apr 2021 15:18:27 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYl-00DCNu-0B; Fri, 02 Apr 2021 15:18:08 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFm3NsKz9v2m3; Fri, 2 Apr 2021 17:18:04 +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 UqB_0D8kMq5r; Fri, 2 Apr 2021 17:18:04 +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 4FBkFm1vXmz9v2ls; Fri, 2 Apr 2021 17:18:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2AD948BB7B; Fri, 2 Apr 2021 17:18:06 +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 Da56GN4Eog_p; Fri, 2 Apr 2021 17:18:06 +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 ABC668BB79; Fri, 2 Apr 2021 17:18:05 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 86AF467989; Fri, 2 Apr 2021 15:18:05 +0000 (UTC) Message-Id: <13fb0995a91bdbce71812794d28cb29070daf51e.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 04/20] drivers: firmware: efi: use cmdline building function 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:05 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161807_144952_4E45584C X-CRM114-Status: GOOD ( 17.22 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Use cmdline building function in EFI. EFI cannot use pr_err() and doesn't have a .init.data section, so use the __cmdline_build() internal function and provides both a source and a destination. Remove the handling of too long command lines as it is handled by the generic CMDLINE. Signed-off-by: Christophe Leroy --- v4: New --- .../firmware/efi/libstub/efi-stub-helper.c | 35 ++++++++++--------- drivers/firmware/efi/libstub/efi-stub.c | 23 +++--------- drivers/firmware/efi/libstub/efistub.h | 2 +- drivers/firmware/efi/libstub/x86-stub.c | 18 +++------- 4 files changed, 29 insertions(+), 49 deletions(-) diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index aa8da0a49829..9f60d471d650 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -13,6 +13,7 @@ #include #include #include /* For CONSOLE_LOGLEVEL_* */ +#include #include #include @@ -339,13 +340,13 @@ void efi_apply_loadoptions_quirk(const void **load_options, int *load_options_si * Size of memory allocated return in *cmd_line_len. * Returns NULL on error. */ -char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len) +char *efi_convert_cmdline(efi_loaded_image_t *image) { const u16 *s2; - unsigned long cmdline_addr = 0; + unsigned long cmdline_addr = 0, options_addr = 0; int options_chars = efi_table_attr(image, load_options_size); const u16 *options = efi_table_attr(image, load_options); - int options_bytes = 0, safe_options_bytes = 0; /* UTF-8 bytes */ + int options_bytes = 0; /* UTF-8 bytes */ bool in_quote = false; efi_status_t status; @@ -354,16 +355,12 @@ char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len) if (options) { s2 = options; - while (options_bytes < COMMAND_LINE_SIZE && options_chars--) { + while (options_chars--) { u16 c = *s2++; if (c < 0x80) { if (c == L'\0' || c == L'\n') break; - if (c == L'"') - in_quote = !in_quote; - else if (!in_quote && isspace((char)c)) - safe_options_bytes = options_bytes; options_bytes++; continue; @@ -395,24 +392,30 @@ char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len) } } } - if (options_bytes >= COMMAND_LINE_SIZE) { - options_bytes = safe_options_bytes; - efi_err("Command line is too long: truncated to %d bytes\n", - options_bytes); - } } options_bytes++; /* NUL termination */ status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, options_bytes, - (void **)&cmdline_addr); + (void **)&options_addr); if (status != EFI_SUCCESS) return NULL; - snprintf((char *)cmdline_addr, options_bytes, "%.*ls", + snprintf((char *)options_addr, options_bytes, "%.*ls", options_bytes - 1, options); - *cmd_line_len = options_bytes; + status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, COMMAND_LINE_SIZE, + (void **)&cmdline_addr); + if (status != EFI_SUCCESS) { + efi_bs_call(free_pool, (void *)options_addr); + return NULL; + } + + if (!__cmdline_build((char *)cmdline_addr, (char *)options_addr)) + efi_err("Command line is too long\n"); + + efi_bs_call(free_pool, (void *)cmdline_addr); + return (char *)cmdline_addr; } diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index 26e69788f27a..b79ee76f2e95 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -127,7 +127,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, unsigned long fdt_addr = 0; /* Original DTB */ unsigned long fdt_size = 0; char *cmdline_ptr = NULL; - int cmdline_size = 0; efi_guid_t loaded_image_proto = LOADED_IMAGE_PROTOCOL_GUID; unsigned long reserve_addr = 0; unsigned long reserve_size = 0; @@ -165,29 +164,17 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, * protocol. We are going to copy the command line into the * device tree, so this can be allocated anywhere. */ - cmdline_ptr = efi_convert_cmdline(image, &cmdline_size); + cmdline_ptr = efi_convert_cmdline(image); if (!cmdline_ptr) { efi_err("getting command line via LOADED_IMAGE_PROTOCOL\n"); status = EFI_OUT_OF_RESOURCES; goto fail; } - if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || - IS_ENABLED(CONFIG_CMDLINE_FORCE) || - cmdline_size == 0) { - status = efi_parse_options(CONFIG_CMDLINE); - if (status != EFI_SUCCESS) { - efi_err("Failed to parse options\n"); - goto fail_free_cmdline; - } - } - - if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && cmdline_size > 0) { - status = efi_parse_options(cmdline_ptr); - if (status != EFI_SUCCESS) { - efi_err("Failed to parse options\n"); - goto fail_free_cmdline; - } + status = efi_parse_options(cmdline_ptr); + if (status != EFI_SUCCESS) { + efi_err("Failed to parse options\n"); + goto fail_free_cmdline; } efi_info("Booting Linux Kernel...\n"); diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index cde0a2ef507d..2f872c48b20b 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -780,7 +780,7 @@ void efi_free(unsigned long size, unsigned long addr); void efi_apply_loadoptions_quirk(const void **load_options, int *load_options_size); -char *efi_convert_cmdline(efi_loaded_image_t *image, int *cmd_line_len); +char *efi_convert_cmdline(efi_loaded_image_t *image); efi_status_t efi_get_memory_map(struct efi_boot_memmap *map); diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 28659276b6ba..0f6a33149ef7 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -359,7 +359,6 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, struct setup_header *hdr; void *image_base; efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; - int options_size = 0; efi_status_t status; char *cmdline_ptr; @@ -404,7 +403,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, hdr->type_of_loader = 0x21; /* Convert unicode cmdline to ascii */ - cmdline_ptr = efi_convert_cmdline(image, &options_size); + cmdline_ptr = efi_convert_cmdline(image); if (!cmdline_ptr) goto fail; @@ -674,6 +673,8 @@ unsigned long efi_main(efi_handle_t handle, unsigned long buffer_start, buffer_end; struct setup_header *hdr = &boot_params->hdr; efi_status_t status; + unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr | + ((u64)boot_params->ext_cmd_line_ptr << 32)); efi_system_table = sys_table_arg; @@ -735,22 +736,11 @@ unsigned long efi_main(efi_handle_t handle, image_offset = 0; } -#ifdef CONFIG_CMDLINE_BOOL - status = efi_parse_options(CONFIG_CMDLINE); + status = efi_parse_options((char *)cmdline_paddr); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); goto fail; } -#endif - if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) { - 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"); - goto fail; - } - } /* * At this point, an initrd may already have been loaded by the From patchwork Fri Apr 2 15:18:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05A0FC433B4 for ; Fri, 2 Apr 2021 15:19:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE97660FD7 for ; Fri, 2 Apr 2021 15:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE97660FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1upGJ9ptVF1Xm5dt6ZjSrOYXnmlVH6GxbJQaln5Fysw=; b=K5DziJ4MksoVxMCxyJAav5BSF3 WVSeMZ8zeB4X4c7HfFBi7UG1z/hqB2dKu5ldYeXpEtC15Eh/wKCEwThABklwEXvKPJihgb9dxAu+t QDQ/6gin6qPwRukmEXsjft4J40AFsRp5CnYA+Fi7/J1ittax7lJIbXt3Avwp9S70sN3EONjrSlwTD VdsH5pbUX/5r+zGoJmJmRrR6yGuK7y2n/sxGkkB6SEMDZ2TpKdqU08aAMTb4CDg5e8qvN/5dfmk6R m8dI6gYn4sIPPICdHHmdvgPmCrEjbivkyMr46N65wb97rUTZp98aBuB6YV1p18+FKueiQyLfFF40h qvQZ3hkg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZs-00DCmg-Dz; Fri, 02 Apr 2021 15:19:16 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYn-00DCPA-0v; Fri, 02 Apr 2021 15:18:10 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFn3JGVz9v2m6; Fri, 2 Apr 2021 17:18:05 +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 VqEXDMYbbW_D; Fri, 2 Apr 2021 17:18:05 +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 4FBkFn2H9Mz9v2ls; Fri, 2 Apr 2021 17:18:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 327708BB7B; Fri, 2 Apr 2021 17:18:07 +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 RgJz95waFuwr; Fri, 2 Apr 2021 17:18:07 +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 BB1658BB79; Fri, 2 Apr 2021 17:18:06 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 8EFAC67989; Fri, 2 Apr 2021 15:18:06 +0000 (UTC) Message-Id: <9cf63d0419bb51d91c5b1c83ce250dff1e7107cc.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 05/20] cmdline: Gives architectures opportunity to use generically defined boot cmdline manipulation 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:06 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161809_161991_F2D560F4 X-CRM114-Status: GOOD ( 17.60 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Most architectures have similar boot command line manipulation options. This patchs adds the definition in init/Kconfig, gated by CONFIG_HAVE_CMDLINE that the architectures can select to use them. CONFIG_CMDLINE_EXTEND is understood differently by architectures. For some of them it appends built-in CMDLINE to bootloader provided line. For others it appends the bootloader provided CMDLINE to the built-in one. To avoid confusion, this commit brings to different options: - CONFIG_CMDLINE_APPEND to append the built-in CMDLINE to the bootloader line. - CONFIG_CMDLINE_PREPEND to prepend the built-in CMDLINE in front of the bootloader line. For compatibility with existing architecture which uses CONFIG_OF, as OF has already been converted to generic cmdline, we keep CONFIG_CMDLINE_EXTEND as a synonym to CONFIG_CMDLINE_APPEND until arm, powerpc, riscv and sh architectures have been converted. A few differences are identified and will have to be taken into account when converting the architecture to generic cmdline: - riscv has CMDLINE_FALLBACK instead of CMDLINE_FROM_BOOTLOADER - Some architectures are using CONFIG_CMDLINE_OVERRIDE or CONFIG_CMDLINE_OVERWRITE instead of CONFIG_CMDLINE_FORCE. Signed-off-by: Christophe Leroy --- v3: - Comments from Will. - Remove CONFIG_CMDLINE_BOOL. Using CONFIG_CMDLINE != "" instead, like arm and powerpc. - Changed EXTEND to APPEND. Keep EXTEND for backward compatibility. v4: - Added CMDLINE_PREPEND as a dependency for INITRAMFS_FORCE - Removed the EXTEND || APPEND in cmdline.h, keep EXTEND as it will always exit and switch to APPEND in last patch. Signed-off-by: Christophe Leroy --- init/Kconfig | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ usr/Kconfig | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/init/Kconfig b/init/Kconfig index 5f5c776ef192..af0d84662cc2 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -117,6 +117,58 @@ config INIT_ENV_ARG_LIMIT Maximum of each of the number of arguments and environment variables passed to init from the kernel command line. +config GENERIC_CMDLINE + bool + +config CMDLINE + string "Default kernel command string" if GENERIC_CMDLINE + default "" + help + Defines a default kernel command string. + If this string is not empty, additional choices are proposed + below to determine how it will be used by the kernel. + +choice + prompt "Kernel command line type" if CMDLINE != "" + default CMDLINE_PREPEND if ARCH_WANT_CMDLINE_PREPEND_BY_DEFAULT + default CMDLINE_FROM_BOOTLOADER + depends on GENERIC_CMDLINE + help + Determine how the default kernel arguments are combined with any + arguments passed by the bootloader if any. + +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_APPEND + bool "Append to the bootloader kernel arguments" + help + The default kernel command string will be appended to the + command-line arguments provided by the bootloader. + +config CMDLINE_PREPEND + bool "Prepend to the bootloader kernel arguments" + help + The default kernel command string will be prepended to the + command-line arguments provided by the bootloader. + +config CMDLINE_FORCE + bool "Always use the default kernel command string" + help + Always use the default kernel command string, ignoring any + arguments provided by the bootloader. +endchoice + +config CMDLINE_EXTEND + bool + default CMDLINE_APPEND + help + To be removed once all architectures are converted to generic CMDLINE + config COMPILE_TEST bool "Compile also drivers which will not load" depends on HAS_IOMEM diff --git a/usr/Kconfig b/usr/Kconfig index 8bbcf699fe3b..b397e6b114d1 100644 --- a/usr/Kconfig +++ b/usr/Kconfig @@ -24,7 +24,7 @@ config INITRAMFS_SOURCE config INITRAMFS_FORCE bool "Ignore the initramfs passed by the bootloader" - depends on CMDLINE_EXTEND || CMDLINE_FORCE + depends on CMDLINE_PREPEND || CMDLINE_APPEND || CMDLINE_FORCE help This option causes the kernel to ignore the initramfs image (or initrd image) passed to it by the bootloader. This is From patchwork Fri Apr 2 15:18:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4852EC433B4 for ; Fri, 2 Apr 2021 15:19:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE0FF60FD7 for ; Fri, 2 Apr 2021 15:19:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE0FF60FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jNQdc8F2H41alGctrsheOVUfyDGUL1e7SLtiv89VUxM=; b=cF9fU/wc/j7ZChoBoY4dzkEjZc rdxuUgDo/0Fys+lbqKAZeqhiXfAmFD90LWOas4fMcjHFpT8JS+jmSAEXxp5a78ACYqmCEM1v6A+qk xspPP36vvIMwBAU7eMnxl8L3cst2U2s2CxqJtbmMklekNxEAJzXfAHJZM383CyCB52bLpkDjX4acD KAslG+CE+GvRBtsNk1B2IeTjTjIr9w1j/WIerO5+i4rBhllxRZHaLHgxLI4BTvU18qJ3e6ObpBOxB 1f7pz2rdzjqyDBfuHiC9yurf7u9MyYOFF8wAZrJwoZL+Y8eBEPFqLzG2nTfjH4fENf7WgnGmRrRX6 B2A9RKAQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZu-00DCpD-7y; Fri, 02 Apr 2021 15:19:18 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYn-00DCPB-8i; Fri, 02 Apr 2021 15:18:11 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFp6jM7z9v2m7; Fri, 2 Apr 2021 17:18:06 +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 Rp6dCVo7JWFW; Fri, 2 Apr 2021 17:18:06 +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 4FBkFp5qTGz9v2ls; Fri, 2 Apr 2021 17:18:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8E5668BB7D; Fri, 2 Apr 2021 17:18:08 +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 gXDC2XbWW9k9; Fri, 2 Apr 2021 17:18:08 +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 C3C0D8BB7C; Fri, 2 Apr 2021 17:18:07 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 960AD67989; Fri, 2 Apr 2021 15:18:07 +0000 (UTC) Message-Id: <03c0b931557967876abcebc7d0e3c6537eb6ab89.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 06/20] powerpc: convert strcpy to strlcpy in prom_init 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:07 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161809_462984_01F9BF7B X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Daniel Walker There's only two users of strcpy and one is the command line handling. The generic command line handling uses strlcpy and it makes sense to convert this one other user to strlcpy to keep prom_init size consistent. Cc: xe-linux-external@cisco.com Signed-off-by: Daniel Walker Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/prom_init.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 41ed7e33d897..33316ee55265 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -242,15 +242,6 @@ static int __init prom_strcmp(const char *cs, const char *ct) return 0; } -static char __init *prom_strcpy(char *dest, const char *src) -{ - char *tmp = dest; - - while ((*dest++ = *src++) != '\0') - /* nothing */; - return tmp; -} - static int __init prom_strncmp(const char *cs, const char *ct, size_t count) { unsigned char c1, c2; @@ -276,6 +267,20 @@ static size_t __init prom_strlen(const char *s) return sc - s; } +static size_t __init prom_strlcpy(char *dest, const char *src, size_t size) +{ + size_t ret = prom_strlen(src); + + if (size) { + size_t len = (ret >= size) ? size - 1 : ret; + + memcpy(dest, src, len); + dest[len] = '\0'; + } + return ret; +} + + static int __init prom_memcmp(const void *cs, const void *ct, size_t count) { const unsigned char *su1, *su2; @@ -2702,7 +2707,7 @@ static void __init flatten_device_tree(void) /* Add "phandle" in there, we'll need it */ namep = make_room(&mem_start, &mem_end, 16, 1); - prom_strcpy(namep, "phandle"); + prom_strlcpy(namep, "phandle", 8); mem_start = (unsigned long)namep + prom_strlen(namep) + 1; /* Build string array */ From patchwork Fri Apr 2 15:18:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C62B2C433B4 for ; Fri, 2 Apr 2021 15:19:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 642BA61056 for ; Fri, 2 Apr 2021 15:19:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 642BA61056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2VdKJZARlFRGpcDHmuZQt/u3SkvAcfchNc4r1NeS8o0=; b=Tc2nMyN6E8bQRA8W5BKZCmzpzs +aZGpZPHEi5oLIaL9PvRFFexnd/jOfhJ+Xu6eIREyuVDVZv/Lu1JqMK6sCnq4n6rCFbV7f/mE7yWN oplNR2W2NOJ+u3b3BmB34MrR4zPhc6cU/yWPYw1lCQd+dhF5dIxxy5EZ4o/dEmygwiMIdvHaV5dhK F9TY2xsHdMWorWXbt7tdVakemfaotDQf8bEuZzkJ0LRgcBQ0DEsoTOK4AhCpxFxsbKkPcB4oPoyNC 4RpTx/DItPQiv+Vf5Y8NziScpNDokgs6K8m5YE0QVcbAWugILNT+PE/uMb+6hF84KrAwPU3dFVgmi 2D7ib2mg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLa9-00DCyS-HF; Fri, 02 Apr 2021 15:19:33 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYn-00DCPu-Op; Fri, 02 Apr 2021 15:18:12 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFq3PhZz9v2lx; Fri, 2 Apr 2021 17:18:07 +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 0PaqD_YmZwDc; Fri, 2 Apr 2021 17:18:07 +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 4FBkFq2Xz3z9v2ls; Fri, 2 Apr 2021 17:18:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4C7DE8BB79; Fri, 2 Apr 2021 17:18:09 +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 raQsvRwETSOo; Fri, 2 Apr 2021 17:18:09 +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 C09DE8BB7E; Fri, 2 Apr 2021 17:18:08 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9D16267989; Fri, 2 Apr 2021 15:18:08 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 07/20] powerpc: 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:08 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161809_962007_EB21D485 X-CRM114-Status: GOOD ( 17.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This updates the powerpc code to use the new cmdline building function. The cmdline_build() defines a temporary string in __initdata. powerpc uses __prombss instead at the moment, so we must call cmdline_build() with destination different from the source to allow GCC to optimise the temporary string out. Signed-off-by: Christophe Leroy --- v4: - Use cmdline_build() instead of __cmdline_build() - Add cmdline_strlcpy() define --- arch/powerpc/Kconfig | 37 +-------------------------------- arch/powerpc/kernel/prom_init.c | 21 +++++++++---------- 2 files changed, 11 insertions(+), 47 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index c1344c05226c..6723f10ac246 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -168,6 +168,7 @@ config PPC select EDAC_SUPPORT select GENERIC_ATOMIC64 if PPC32 select GENERIC_CLOCKEVENTS_BROADCAST if SMP + select GENERIC_CMDLINE select GENERIC_CMOS_UPDATE select GENERIC_CPU_AUTOPROBE select GENERIC_CPU_VULNERABILITIES if PPC_BARRIER_NOSPEC @@ -888,42 +889,6 @@ config PPC_DENORMALISATION Add support for handling denormalisation of single precision values. Useful for bare metal only. If unsure say Y here. -config CMDLINE - string "Initial kernel command string" - default "" - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, you can supply - some command-line options at build time by entering them here. In - most cases you will need to specify the root device here. - -choice - prompt "Kernel command line type" if CMDLINE != "" - default CMDLINE_FROM_BOOTLOADER - -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_EXTEND - bool "Extend bootloader kernel arguments" - help - The command-line arguments provided by the boot loader will be - appended to the default kernel command string. - -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 EXTRA_TARGETS string "Additional default image types" help diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 33316ee55265..704afd028213 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -152,7 +152,7 @@ static struct prom_t __prombss prom; static unsigned long __prombss prom_entry; static char __prombss of_stdout_device[256]; -static char __prombss prom_scratch[256]; +static char __prombss prom_scratch[COMMAND_LINE_SIZE]; static unsigned long __prombss dt_header_start; static unsigned long __prombss dt_struct_start, dt_struct_end; @@ -770,24 +770,23 @@ static unsigned long prom_memparse(const char *ptr, const char **retptr) * Early parsing of the command line passed to the kernel, used for * "mem=x" and the options that affect the iommu */ +#define cmdline_strlcat prom_strlcat +#define cmdline_strlcpy prom_strlcpy +#include + static void __init early_cmdline_parse(void) { const char *opt; - - char *p; int l = 0; - - prom_cmd_line[0] = 0; - p = prom_cmd_line; + bool truncated; if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && (long)prom.chosen > 0) - l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1); + l = prom_getprop(prom.chosen, "bootargs", prom_scratch, + COMMAND_LINE_SIZE - 1); - if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || l <= 0 || p[0] == '\0') - prom_strlcat(prom_cmd_line, " " CONFIG_CMDLINE, - sizeof(prom_cmd_line)); + truncated = !__cmdline_build(prom_cmd_line, l > 0 ? prom_scratch : NULL); - prom_printf("command line: %s\n", prom_cmd_line); + prom_printf("command line: %s %s\n", prom_cmd_line, truncated ? "[truncated]" : ""); #ifdef CONFIG_PPC64 opt = prom_strstr(prom_cmd_line, "iommu="); From patchwork Fri Apr 2 15:18:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3445FC433B4 for ; Fri, 2 Apr 2021 15:20:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D95AA61057 for ; Fri, 2 Apr 2021 15:20:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D95AA61057 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4qbn5lvzhi+oeFsLzAsn5xToSG97tVEO8fgFBdNOrjA=; b=etL+jMLnXsJue5Gqf94qZiCf1r TXFzbI61wJVvMXceqf1fgCy0aTTN1ESOHfvhCA49kPealSMJ745gTnFV9tNE5TzRj95bOevy/zJeY 1p8fkyoHN8D6UOxKCtRAs9z+YxW7Pz5i7LHQFllRe4oG4CN6i3SrUXQJUFOWzmmKWKaEtWHqtjsVV f0NOanrwivFcMGnWmRRMqfo5Dm2PoQbXfYOi7F6oZh6aPCt+f0xcXsrxECnrBaCJUVqHBc6TMN+Ij E73MkqBjcZEAifeH/fhUzkj97AoeLXs29dss3f1cFrA4qcNMiPPL+x1tsXa6y5LXq3mVO256o+hun cGwCpOgg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLae-00DDHk-DM; Fri, 02 Apr 2021 15:20:05 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYo-00DCQQ-Qg; Fri, 02 Apr 2021 15:18:12 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFr3RcWz9v2m8; Fri, 2 Apr 2021 17:18:08 +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 GxtO1UqBUW7x; Fri, 2 Apr 2021 17:18:08 +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 4FBkFr2PTSz9v2ls; Fri, 2 Apr 2021 17:18:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 34FB48BB7B; Fri, 2 Apr 2021 17:18:10 +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 BmkAXxz0r5S7; Fri, 2 Apr 2021 17:18:10 +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 D1B498BB79; Fri, 2 Apr 2021 17:18:09 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A374467989; Fri, 2 Apr 2021 15:18:09 +0000 (UTC) Message-Id: <2e49b9ae60a90aec8b555946279cab059a2812a4.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 08/20] arm: 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:09 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161811_150642_1C600A4B X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- v4: - Removed dependency to ATAGS - Removed the message when forcing --- arch/arm/Kconfig | 38 +---------------------------------- arch/arm/kernel/atags_parse.c | 13 +++--------- 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5da96f5df48f..1a1808b0eef7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -50,6 +50,7 @@ config ARM select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY select GENERIC_ATOMIC64 if CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI select GENERIC_CLOCKEVENTS_BROADCAST if SMP + select GENERIC_CMDLINE select GENERIC_IRQ_IPI if SMP select GENERIC_CPU_AUTOPROBE select GENERIC_EARLY_IOREMAP @@ -1740,43 +1741,6 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND endchoice -config CMDLINE - string "Default kernel command string" - default "" - help - On some architectures (e.g. CATS), there is currently no way - for the boot loader to pass arguments to the kernel. For these - architectures, you should supply some command-line options at build - time by entering them here. As a minimum, you should specify the - memory size and the root device (e.g., mem=64M root=/dev/nfs). - -choice - prompt "Kernel command line type" if CMDLINE != "" - default CMDLINE_FROM_BOOTLOADER - depends on ATAGS - -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_EXTEND - bool "Extend bootloader kernel arguments" - help - The command-line arguments provided by the boot loader will be - appended to the default kernel command string. - -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 XIP_KERNEL bool "Kernel Execute-In-Place from ROM" depends on !ARM_LPAE && !ARCH_MULTIPLATFORM diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c index 373b61f9a4f0..ef97ec015c51 100644 --- a/arch/arm/kernel/atags_parse.c +++ b/arch/arm/kernel/atags_parse.c @@ -14,6 +14,7 @@ * is not parsed in any way). */ +#include #include #include #include @@ -120,16 +121,8 @@ __tagtable(ATAG_REVISION, parse_tag_revision); static int __init parse_tag_cmdline(const struct tag *tag) { -#if defined(CONFIG_CMDLINE_EXTEND) - strlcat(default_command_line, " ", COMMAND_LINE_SIZE); - strlcat(default_command_line, tag->u.cmdline.cmdline, - COMMAND_LINE_SIZE); -#elif defined(CONFIG_CMDLINE_FORCE) - pr_warn("Ignoring tag cmdline (using the default kernel command line)\n"); -#else - strlcpy(default_command_line, tag->u.cmdline.cmdline, - COMMAND_LINE_SIZE); -#endif + cmdline_build(default_command_line, tag->u.cmdline.cmdline); + return 0; } From patchwork Fri Apr 2 15:18:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B191C433B4 for ; Fri, 2 Apr 2021 15:20:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 362A060FD7 for ; Fri, 2 Apr 2021 15:20:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 362A060FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=l6eQfAISrTLzbcNnmsSUdUnj8F5AsxGC/7nXHFu9Q9I=; b=TilaFy5UVkJt9N/P56sRDIw9fb wqVK/1xH0lM4PMYvC5uUd/gmJnr6xBnjVpAP0PbvE1vLKIPSVKgCpO817i2gTBIC29wSPApxoje9Z 8fBkmo+Rzw+AWrUVHfKaX/eeddg/fjYMnoM32eC3m8JvtbkoWblCZul/tKt9WraUe5hMTPR1POzGc fPwS+y3dK/FgfwlL/Zw2FlzvN8GRWWHkvImsqOg+E9WL8HC9Reip7udItQvd5zemPiDu3XONo8/+O iEEN81hnvXXyywSr9uHpfJAe6DlZ1Ioco0L5MHpLw62o6x+4hfMDflhjpRd0WID+DDyRs1INjnxqJ pFfO0xnw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLai-00DDKU-Mu; Fri, 02 Apr 2021 15:20:08 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYq-00DCR5-Cq; Fri, 02 Apr 2021 15:18:14 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFt0gKkz9v2lt; Fri, 2 Apr 2021 17:18:10 +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 G_aS3o--dyaE; Fri, 2 Apr 2021 17:18:10 +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 4FBkFs6ZBKz9v2ls; Fri, 2 Apr 2021 17:18:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id AFD2D8BB7B; Fri, 2 Apr 2021 17:18:11 +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 Pkw9Ff5U_wk1; Fri, 2 Apr 2021 17:18:11 +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 DCD6A8BB79; Fri, 2 Apr 2021 17:18:10 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id B36F067989; Fri, 2 Apr 2021 15:18:10 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 09/20] arm64: 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:10 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161812_586965_EF720275 X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/arm64/Kconfig | 33 +----------------------------- arch/arm64/kernel/idreg-override.c | 9 ++++---- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e4e1b6550115..9781ba3758b1 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -105,6 +105,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 @@ -1841,38 +1842,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 diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c index 83f1c4b92095..96a4e96a80a2 100644 --- a/arch/arm64/kernel/idreg-override.c +++ b/arch/arm64/kernel/idreg-override.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -187,12 +188,10 @@ static __init const u8 *get_bootargs_cmdline(void) static __init void parse_cmdline(void) { const u8 *prop = get_bootargs_cmdline(); + static char __initdata cmdline[COMMAND_LINE_SIZE]; - if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop) - __parse_cmdline(CONFIG_CMDLINE, true); - - if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop) - __parse_cmdline(prop, true); + cmdline_build(cmdline, prop); + __parse_cmdline(cmdline, true); } /* Keep checkers quiet */ From patchwork Fri Apr 2 15:18:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B0CCC43460 for ; Fri, 2 Apr 2021 15:21:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF4DB61056 for ; Fri, 2 Apr 2021 15:21:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF4DB61056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O6hQju1Ao1BbyHapgg6xbrV03mp+sc8ttqmVMQqcU5Q=; b=dD5qDQH1icKuVRmvy0UsApg2s0 7V4S2J5wsj7nh7Lr1QRiNVKaNL5PuLd5a3KS/9odBdCXuf7L5f2cetAD0nko33d7MVKtuf+L+a9LM sN0bvXGNTTezEO5GZD2IjiuxFPDarNxThL8gO/PMgtGfXJ139fO4JizpvRxRbjiuZ112u4zNNDvff BngxFJj4hKsMXP2P1H2mOhdo55QINLDMqP6QaMY8rEoRakcnjTc75aa34coB5tDM04asAXzOMV6gS FikewPVKHfReqbMzpXZW9iMX6BPAfFDuMQPje+be8dBMpXYlBcoQuH6nwPuDZfMiCumeO6g3uaa2y GBy6h2ew==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLbU-00DEEc-LZ; Fri, 02 Apr 2021 15:20:56 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYq-00DCRQ-St; Fri, 02 Apr 2021 15:18:17 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFt4S04z9v2lv; Fri, 2 Apr 2021 17:18:10 +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 sA0hud0WLToF; Fri, 2 Apr 2021 17:18:10 +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 4FBkFt3brMz9v2ls; Fri, 2 Apr 2021 17:18:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 68B998BB7B; Fri, 2 Apr 2021 17:18:12 +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 b-4XVonvcJNM; Fri, 2 Apr 2021 17:18:12 +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 EB36D8BB79; Fri, 2 Apr 2021 17:18:11 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C79AA67989; Fri, 2 Apr 2021 15:18:11 +0000 (UTC) Message-Id: <1180421ba35993f4a533708b91c93f1da07d14dc.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 10/20] hexagon: 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:11 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161815_505645_AD487CDF X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/hexagon/Kconfig | 11 +---------- arch/hexagon/kernel/setup.c | 10 ++-------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 44a409967af1..1e69c99bae6b 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -18,6 +18,7 @@ config HEXAGON select HAVE_PERF_EVENTS # GENERIC_ALLOCATOR is used by dma_alloc_coherent() select GENERIC_ALLOCATOR + select GENERIC_CMDLINE select GENERIC_IRQ_SHOW select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK @@ -91,16 +92,6 @@ config HEXAGON_ARCH_VERSION int "Architecture version" default 2 -config CMDLINE - string "Default kernel command string" - default "" - help - On some platforms, there is currently no way for the boot loader - to pass arguments to the kernel. For these, you should supply some - command-line options at build time by entering them here. At a - minimum, you should specify the memory size and the root device - (e.g., mem=64M root=/dev/nfs). - config SMP bool "Multi-Processing support" help diff --git a/arch/hexagon/kernel/setup.c b/arch/hexagon/kernel/setup.c index 1880d9beaf2b..78641ce219e2 100644 --- a/arch/hexagon/kernel/setup.c +++ b/arch/hexagon/kernel/setup.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -22,7 +23,6 @@ #include char cmd_line[COMMAND_LINE_SIZE]; -static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; int on_simulator; @@ -38,8 +38,6 @@ void calibrate_delay(void) void __init setup_arch(char **cmdline_p) { - char *p = &external_cmdline_buffer; - /* * These will eventually be pulled in via either some hypervisor * or devicetree description. Hardwiring for now. @@ -65,11 +63,7 @@ void __init setup_arch(char **cmdline_p) else on_simulator = 0; - if (p[0] != '\0') - strlcpy(boot_command_line, p, COMMAND_LINE_SIZE); - else - strlcpy(boot_command_line, default_command_line, - COMMAND_LINE_SIZE); + cmdline_build(boot_command_line, external_cmdline_buffer); /* * boot_command_line and the value set up by setup_arch From patchwork Fri Apr 2 15:18:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9FA5C433ED for ; Fri, 2 Apr 2021 15:21:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57A2F60FD7 for ; Fri, 2 Apr 2021 15:21:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57A2F60FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HhexX7+7t4TvH9BktltG3vjb2jeso5vWJUsUrE6U1H0=; b=NCLn5DjsmtAKAdOqYecNyA4RUV 9EXiupSj2Z9yGZk5BqKYph+PHXVJxlKImnSQ+IIJyQlldMBbn1sIYxhYNk/RHrned25Du60F4J5Up rWuHo/AJnpQXb6Km4zi9FQ04QuyJJZr+u88+NGIKFHm6YZejPrEqSCSABbKO0Bt5Ay/DUi/1VKAW1 RUYm9I2jSNio3pIIuQIK8gDEvznGl1kKIED6LMnmafDhBMHh2T1B0ah15EBckIXeenb+wUWFrkU7O EGKBn3sRtX8PyOwPjjBUHUk+UHZv2IYGyV4rdfo6SjKngxoOu0SxyvFCz7tp/lodyRQEPOczaotJf Xc97tu9w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLbX-00DEIv-Ii; Fri, 02 Apr 2021 15:20:59 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYs-00DCRT-4u; Fri, 02 Apr 2021 15:18:17 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFv5gXmz9v2lw; Fri, 2 Apr 2021 17:18:11 +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 ZVGa-EQtaQRr; Fri, 2 Apr 2021 17:18:11 +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 4FBkFv4Sv5z9v2ls; Fri, 2 Apr 2021 17:18:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 83CBF8BB7C; Fri, 2 Apr 2021 17:18:13 +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 ePI0pVGy8P5x; Fri, 2 Apr 2021 17:18:13 +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 2FEB68BB79; Fri, 2 Apr 2021 17:18:13 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id F0BE667989; Fri, 2 Apr 2021 15:18:12 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 11/20] microblaze: 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:12 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161815_494231_C4F73420 X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/microblaze/Kconfig | 24 +----------------------- arch/microblaze/configs/mmu_defconfig | 2 +- arch/microblaze/kernel/head.S | 4 ++-- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 0660f47012bc..1242f34bc2a2 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -15,6 +15,7 @@ config MICROBLAZE select COMMON_CLK select DMA_DIRECT_REMAP select GENERIC_ATOMIC64 + select GENERIC_CMDLINE select GENERIC_CPU_DEVICES select GENERIC_IDLE_POLL_SETUP select GENERIC_IRQ_PROBE @@ -93,29 +94,6 @@ source "kernel/Kconfig.hz" config MMU def_bool y -comment "Boot options" - -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - -config CMDLINE - string "Default kernel command string" - depends on CMDLINE_BOOL - default "console=ttyUL0,115200" - help - On some architectures there is currently no way for the boot loader - to pass arguments to the kernel. For these architectures, you should - supply some command-line options at build time by entering them - here. - -config CMDLINE_FORCE - bool "Force default kernel command string" - depends on CMDLINE_BOOL - default n - help - Set this to have arguments from the default kernel command string - override those passed by the boot loader. - endmenu menu "Kernel features" diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig index 51337fffb947..b4d2219d0a8f 100644 --- a/arch/microblaze/configs/mmu_defconfig +++ b/arch/microblaze/configs/mmu_defconfig @@ -16,7 +16,7 @@ CONFIG_XILINX_MICROBLAZE0_USE_DIV=1 CONFIG_XILINX_MICROBLAZE0_USE_HW_MUL=2 CONFIG_XILINX_MICROBLAZE0_USE_FPU=2 CONFIG_HZ_100=y -CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="console=ttyUL0,115200" CONFIG_CMDLINE_FORCE=y CONFIG_HIGHMEM=y CONFIG_PCI_XILINX=y diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S index ec2fcb545e64..605b18c86ac8 100644 --- a/arch/microblaze/kernel/head.S +++ b/arch/microblaze/kernel/head.S @@ -105,7 +105,7 @@ _copy_fdt: addik r3, r3, -4 /* descrement loop */ no_fdt_arg: -#ifndef CONFIG_CMDLINE_BOOL +#if CONFIG_CMDLINE == "" /* * handling command line * copy command line directly to cmd_line placed in data section. @@ -126,7 +126,7 @@ _copy_command_line: addik r5, r4, 0 /* add new space for command line */ tovirt(r5,r5) skip: -#endif /* CONFIG_CMDLINE_BOOL */ +#endif /* CONFIG_CMDLINE */ #ifdef NOT_COMPILE /* save bram context */ From patchwork Fri Apr 2 15:18:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7409BC433B4 for ; Fri, 2 Apr 2021 15:22:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F05E60FD7 for ; Fri, 2 Apr 2021 15:22:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F05E60FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c93MGgTyo3nxu+fAkHo1/AQIZEi9XkwWg/KL2Px61AE=; b=FC2YJKGi0suO2XoGud7W4iFr/f s7kK/bKtkGtpGxeI+FdxCJcAZCnWheMBqtJTkXCREE8V7Kcg+Iuv+fyZNv7+kuzxZjvHaXU1Y7E1o eTVqvIHNm1o80pdg3YZ5JlR8yjra+tsS1pt8SJepNwM5lMCy3O5P6nd9Netez9kMgn7rds1Szrl3U 00DoDfnmq6h+7/oBKWxiJ1NsaIJNRDlKRfnOLI5OUSTtUr+WM0CnM/GxNYxsKZ4HKJTf30RIRGv1y 3MQSiAURwLWbAHNSo4069ZvThkzNDfHNuV5o/FiwRJmQ8TN2nMT6dNU217BhUdAQ61DTD1s3WsTxR GK6FWrgg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLcd-00DFXF-KA; Fri, 02 Apr 2021 15:22:07 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYt-00DCRb-BX; Fri, 02 Apr 2021 15:18:18 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFx03zqz9v2m3; Fri, 2 Apr 2021 17:18:13 +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 A8kam4b7TJbi; Fri, 2 Apr 2021 17:18:12 +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 4FBkFw53rLz9v2ls; Fri, 2 Apr 2021 17:18:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7C7E18BB7F; Fri, 2 Apr 2021 17:18:14 +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 H5LeedaB8gob; Fri, 2 Apr 2021 17:18:14 +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 25D4A8BB79; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0385767989; Fri, 2 Apr 2021 15:18:13 +0000 (UTC) Message-Id: <9b4899b0abc156eb207b19fe0b24dd5bf0355b99.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 12/20] nios2: 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:13 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161815_579061_30E83CC9 X-CRM114-Status: GOOD ( 13.59 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- v4: Added missing selection of CONFIG_GENERIC_CMDLINE in Kconfig --- arch/nios2/Kconfig | 25 ++----------------------- arch/nios2/kernel/setup.c | 13 ++++--------- 2 files changed, 6 insertions(+), 32 deletions(-) diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig index c24955c81c92..6018f3d626f8 100644 --- a/arch/nios2/Kconfig +++ b/arch/nios2/Kconfig @@ -10,6 +10,7 @@ config NIOS2 select COMMON_CLK select TIMER_OF select GENERIC_ATOMIC64 + select GENERIC_CMDLINE select GENERIC_CPU_DEVICES select GENERIC_IRQ_PROBE select GENERIC_IRQ_SHOW @@ -90,31 +91,9 @@ config NIOS2_ALIGNMENT_TRAP comment "Boot options" -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - default y - -config CMDLINE - string "Default kernel command string" - default "" - depends on CMDLINE_BOOL - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, you can supply - some command-line options at build time by entering them here. In - other cases you can specify kernel args so that you don't have - to set them up in board prom initialization routines. - -config CMDLINE_FORCE - bool "Force default kernel command string" - depends on CMDLINE_BOOL - help - Set this to have arguments from the default kernel command string - override those passed by the boot loader. - config NIOS2_CMDLINE_IGNORE_DTB bool "Ignore kernel command string from DTB" - depends on CMDLINE_BOOL + depends on CMDLINE != "" depends on !CMDLINE_FORCE default y help diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c index d2f21957e99c..5b38d3d0ad64 100644 --- a/arch/nios2/kernel/setup.c +++ b/arch/nios2/kernel/setup.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -108,7 +109,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, unsigned r7) { unsigned dtb_passed = 0; - char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, }; + char cmdline_passed[COMMAND_LINE_SIZE] = { 0, }; #if defined(CONFIG_NIOS2_PASS_CMDLINE) if (r4 == 0x534f494e) { /* r4 is magic NIOS */ @@ -127,14 +128,8 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6, early_init_devtree((void *)dtb_passed); -#ifndef CONFIG_CMDLINE_FORCE - if (cmdline_passed[0]) - strlcpy(boot_command_line, cmdline_passed, COMMAND_LINE_SIZE); -#ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB - else - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); -#endif -#endif + if (cmdline_passed[0] || IS_ENABLED(CONFIG_NIOS2_CMDLINE_IGNORE_DTB)) + cmdline_build(boot_command_line, cmdline_passed); parse_early_param(); } From patchwork Fri Apr 2 15:18:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61CA1C433ED for ; Fri, 2 Apr 2021 15:21:26 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11BB060FD7 for ; Fri, 2 Apr 2021 15:21:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11BB060FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=94ihs1qmqfADHPk3yPE4jMb2Fl6BtODRoTNpQhT89Tc=; b=bSr206MyXSb7qthLP8+6vKQcAz UZcuw6Z16XM3NFDMJCk45U+A7Un+Fn003h7hd7o/KPv2ZkgsG/aoeVKhkHF7LRzhliVhCD+w3J66C oPv4pWjhOr+dG7uepIC8Mjt9kC/Xgjig7lbUoyTWfEWtFLZo0CRJqmFfBKcPErwmqcosd7hQhD6Se TBOVO7EttqBSd6fzSgF3znyUZIjBBbKS1SpIBEMrc780r0Zp13TisGIkL2uZ2LWQHMjsb5yTwtsdb iL9NHbbgad5ntfDZ00sXTbzmdjdFvS4Wy+QqXrKsvRs8AvxRdCdVu0EJvMs8idOAZAVoNoIR4HWbB Lea6EeBw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLbq-00DEhU-NE; Fri, 02 Apr 2021 15:21:19 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYv-00DCSX-0c; Fri, 02 Apr 2021 15:18:18 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFy5920z9v2m1; Fri, 2 Apr 2021 17:18:14 +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 Rh8zlz5qcMBy; Fri, 2 Apr 2021 17:18:14 +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 4FBkFy4MLYz9v2ls; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5CD788BB7F; Fri, 2 Apr 2021 17:18:16 +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 P96hx1zJN4mx; Fri, 2 Apr 2021 17:18:16 +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 31B0E8BB7D; Fri, 2 Apr 2021 17:18:15 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0BAA367989; Fri, 2 Apr 2021 15:18:15 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 13/20] openrisc: 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:15 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161817_278538_6CCEF1A8 X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/openrisc/Kconfig | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 591acc5990dc..ca1d0f18fe16 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -25,6 +25,7 @@ config OPENRISC select HAVE_UID16 select GENERIC_ATOMIC64 select GENERIC_CLOCKEVENTS_BROADCAST + select GENERIC_CMDLINE select GENERIC_STRNCPY_FROM_USER select GENERIC_STRNLEN_USER select GENERIC_SMP_IDLE_THREAD @@ -162,15 +163,6 @@ config OPENRISC_HAVE_SHADOW_GPRS On SMP systems, this feature is mandatory. On a unicore system it's safe to say N here if you are unsure. -config CMDLINE - string "Default kernel command string" - default "" - help - On some architectures there is currently no way for the boot loader - to pass arguments to the kernel. For these architectures, you should - supply some command-line options at build time by entering them - here. - menu "Debugging options" config JUMP_UPON_UNHANDLED_EXCEPTION From patchwork Fri Apr 2 15:18:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A4F4C433B4 for ; Fri, 2 Apr 2021 15:22:19 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9C7D60FD7 for ; Fri, 2 Apr 2021 15:22:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9C7D60FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IxPtw8joGvt6lgD0azcR1CNQo93LNKFbyRA3snzTTxQ=; b=gXZV5uu+HAbhfLxNKxtq7bn21L a2QGWszRdXDNEkLKgeMMlTZcMogGgCbY5SV6os6+4Tx2S6HMILZlwGCUNU5ktGuxjYt6lKU6VQQl2 VN8Rs/uyy8MB8M90hM0BF8iUfXBA+6w7pg/1yhUdScGqrlD2hEVM6EKbdrzR4j51SNTqqc4B+uz+f RY15wx0HnRcDc5RyBFJB7PI+8hM627AguM8eVdzDiTTwefoJMvJBaxTJz5UqxbG/hdZOS+5oCKmG6 lys5z7/tWbKzxMYVDhMoqXSn6BeXDTfIQOtK1scsRcHQTMaH+3FvElUUFFcA4FtmIkaSuefVIAS5z VImWJfSA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLch-00DFcf-5m; Fri, 02 Apr 2021 15:22:11 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYv-00DCSZ-EU; Fri, 02 Apr 2021 15:18:19 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkFz0Y09z9v2mB; Fri, 2 Apr 2021 17:18:15 +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 TNsWx4HFdgfR; Fri, 2 Apr 2021 17:18:14 +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 4FBkFy6Rvjz9v2ls; Fri, 2 Apr 2021 17:18:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BA3E68BB79; Fri, 2 Apr 2021 17:18:16 +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 kXdNH-tnbrin; Fri, 2 Apr 2021 17:18:16 +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 3C7018BB7C; Fri, 2 Apr 2021 17:18:16 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 12AC46798A; Fri, 2 Apr 2021 15:18:16 +0000 (UTC) Message-Id: <9590d262050923a22d434358a9037131f67fcaae.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 14/20] riscv: 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:16 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161817_581738_229C3079 X-CRM114-Status: GOOD ( 14.89 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- v4: Remove the message when forcing --- arch/riscv/Kconfig | 44 +-------------------------------------- arch/riscv/kernel/setup.c | 7 +++---- 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 87d7b52f278f..3dbd50bed037 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -39,6 +39,7 @@ config RISCV select EDAC_SUPPORT select GENERIC_ARCH_TOPOLOGY if SMP select GENERIC_ATOMIC64 if !64BIT + select GENERIC_CMDLINE select GENERIC_EARLY_IOREMAP select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO select GENERIC_IOREMAP @@ -390,49 +391,6 @@ endmenu menu "Boot options" -config CMDLINE - string "Built-in kernel command line" - help - For most platforms, the arguments for the kernel's command line - are provided at run-time, during boot. However, there are cases - where either no arguments are being provided or the provided - arguments are insufficient or even invalid. - - When that occurs, it is possible to define a built-in command - line here and choose how the kernel should use it later on. - -choice - prompt "Built-in command line usage" if CMDLINE != "" - default CMDLINE_FALLBACK - help - Choose how the kernel will handle the provided built-in command - line. - -config CMDLINE_FALLBACK - bool "Use bootloader kernel arguments if available" - help - Use the built-in command line as fallback in case we get nothing - during boot. This is the default behaviour. - -config CMDLINE_EXTEND - bool "Extend bootloader kernel arguments" - help - The command-line arguments provided during boot will be - appended to the built-in command line. This is useful in - cases where the provided arguments are insufficient and - you don't want to or cannot modify them. - - -config CMDLINE_FORCE - bool "Always use the default kernel command string" - help - Always use the built-in command line, even if we get one during - boot. This is useful in case you need to override the provided - command line on systems where you don't have or want control - over it. - -endchoice - config EFI_STUB bool diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index f8f15332caa2..d4f16a9c1762 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -228,10 +229,8 @@ static void __init parse_dtb(void) } pr_err("No DTB passed to the kernel\n"); -#ifdef CONFIG_CMDLINE_FORCE - strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); - pr_info("Forcing kernel command line to: %s\n", boot_command_line); -#endif + + cmdline_build(boot_command_line, NULL); } void __init setup_arch(char **cmdline_p) From patchwork Fri Apr 2 15:18:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 845FDC433B4 for ; Fri, 2 Apr 2021 15:22:43 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B46861056 for ; Fri, 2 Apr 2021 15:22:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B46861056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6smerfBlku0tMR0aIujdXYn9WXefzUKhvYt/t8zYM5E=; b=nRkEGByd/gRtZLC1L4/LyvGX+n dXCq+D4oMKz94hkuCy2T1sqJRXNlqtpB3aQSD2FsLL+IfRz6NJMZSxXcxT6YcYThmC8o4ZP+GZ3ww Zdw8Hh53xiqY9mJ1gdI4kvFHfQbQeN1MqYi5UhnvWfirHGM2pGL0oA5JVmCglZDf47yT0/gDBXFlU 1EXly6Uy3BHHeAASSUIn6NqwOZm1y9tAtr2lbNExWQ8lJ27+7KV1aPyvENRWW1//iYEvwy1QAxHoO w5lOxnzILCMMRq94kcDukkIp5kLvHi28/dkhiv6icad3Unc+emW9sGrid1naMJkzeT742+F96k3P4 G9Kn5SBg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLd5-00DFr7-Cv; Fri, 02 Apr 2021 15:22:35 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYw-00DCTM-Gs; Fri, 02 Apr 2021 15:18:21 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG01f94z9v2m6; Fri, 2 Apr 2021 17:18:16 +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 swV5Eg2aMaDR; Fri, 2 Apr 2021 17:18:16 +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 4FBkG00Z8Wz9v2ls; Fri, 2 Apr 2021 17:18:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BFA948BB7D; Fri, 2 Apr 2021 17:18:17 +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 GNJUI4yPQWh2; Fri, 2 Apr 2021 17:18:17 +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 3D51D8BB7C; Fri, 2 Apr 2021 17:18:17 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 1A5C167989; Fri, 2 Apr 2021 15:18:17 +0000 (UTC) Message-Id: <56269e717991d446112958ecf7340ce095b371a6.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 15/20] sh: 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:17 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161818_778504_2D9CDA20 X-CRM114-Status: GOOD ( 10.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- v4: Restore the removed 'endmenu' in Kconfig --- arch/sh/Kconfig | 28 +-------------------- arch/sh/configs/ap325rxa_defconfig | 2 +- arch/sh/configs/dreamcast_defconfig | 2 +- arch/sh/configs/ecovec24-romimage_defconfig | 2 +- arch/sh/configs/ecovec24_defconfig | 2 +- arch/sh/configs/edosk7760_defconfig | 2 +- arch/sh/configs/espt_defconfig | 2 +- arch/sh/configs/j2_defconfig | 2 +- arch/sh/configs/kfr2r09-romimage_defconfig | 2 +- arch/sh/configs/kfr2r09_defconfig | 2 +- arch/sh/configs/lboxre2_defconfig | 2 +- arch/sh/configs/microdev_defconfig | 2 +- arch/sh/configs/migor_defconfig | 2 +- arch/sh/configs/polaris_defconfig | 2 +- arch/sh/configs/r7780mp_defconfig | 2 +- arch/sh/configs/r7785rp_defconfig | 2 +- arch/sh/configs/rsk7201_defconfig | 2 +- arch/sh/configs/rsk7203_defconfig | 2 +- arch/sh/configs/rts7751r2d1_defconfig | 2 +- arch/sh/configs/rts7751r2dplus_defconfig | 2 +- arch/sh/configs/sdk7780_defconfig | 2 +- arch/sh/configs/sdk7786_defconfig | 2 +- arch/sh/configs/se7206_defconfig | 2 +- arch/sh/configs/se7343_defconfig | 2 +- arch/sh/configs/se7712_defconfig | 2 +- arch/sh/configs/se7721_defconfig | 2 +- arch/sh/configs/se7724_defconfig | 2 +- arch/sh/configs/se7751_defconfig | 2 +- arch/sh/configs/se7780_defconfig | 2 +- arch/sh/configs/sh03_defconfig | 2 +- arch/sh/configs/sh2007_defconfig | 2 +- arch/sh/configs/sh7757lcr_defconfig | 2 +- arch/sh/configs/sh7763rdp_defconfig | 2 +- arch/sh/configs/shmin_defconfig | 2 +- arch/sh/configs/shx3_defconfig | 2 +- arch/sh/configs/titan_defconfig | 2 +- arch/sh/configs/ul2_defconfig | 2 +- arch/sh/kernel/setup.c | 11 ++------ 38 files changed, 39 insertions(+), 72 deletions(-) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index e798e55915c2..92d6a4443166 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -16,6 +16,7 @@ config SUPERH select CPU_NO_EFFICIENT_FFS select DMA_DECLARE_COHERENT select GENERIC_ATOMIC64 + select GENERIC_CMDLINE select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST select GENERIC_IDLE_POLL_SETUP select GENERIC_IRQ_SHOW @@ -742,33 +743,6 @@ config ROMIMAGE_MMCIF first part of the romImage which in turn loads the rest the kernel image to RAM using the MMCIF hardware block. -choice - prompt "Kernel command line" - optional - default CMDLINE_OVERWRITE - help - Setting this option allows the kernel command line arguments - to be set. - -config CMDLINE_OVERWRITE - bool "Overwrite bootloader kernel arguments" - help - Given string will overwrite any arguments passed in by - a bootloader. - -config CMDLINE_EXTEND - bool "Extend bootloader kernel arguments" - help - Given string will be concatenated with arguments passed in - by a bootloader. - -endchoice - -config CMDLINE - string "Kernel command line arguments string" - depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND - default "console=ttySC1,115200" - endmenu menu "Bus options" diff --git a/arch/sh/configs/ap325rxa_defconfig b/arch/sh/configs/ap325rxa_defconfig index 5193b3e099b9..3997aa49c75b 100644 --- a/arch/sh/configs/ap325rxa_defconfig +++ b/arch/sh/configs/ap325rxa_defconfig @@ -15,7 +15,7 @@ CONFIG_SH_AP325RXA=y CONFIG_HIGH_RES_TIMERS=y CONFIG_SECCOMP=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty1 console=ttySC5,38400 root=/dev/nfs ip=dhcp" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/dreamcast_defconfig b/arch/sh/configs/dreamcast_defconfig index 6a82c7b8ff32..ac030c1a351e 100644 --- a/arch/sh/configs/dreamcast_defconfig +++ b/arch/sh/configs/dreamcast_defconfig @@ -22,7 +22,7 @@ CONFIG_NR_DMA_CHANNELS_BOOL=y CONFIG_NR_DMA_CHANNELS=9 CONFIG_SECCOMP=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 panic=3" CONFIG_MAPLE=y CONFIG_PCI=y diff --git a/arch/sh/configs/ecovec24-romimage_defconfig b/arch/sh/configs/ecovec24-romimage_defconfig index 5c60e71d839e..db78857ae30f 100644 --- a/arch/sh/configs/ecovec24-romimage_defconfig +++ b/arch/sh/configs/ecovec24-romimage_defconfig @@ -14,7 +14,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_ECOVEC=y # CONFIG_SH_TIMER_TMU is not set CONFIG_KEXEC=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200" # CONFIG_SUSPEND is not set CONFIG_NET=y diff --git a/arch/sh/configs/ecovec24_defconfig b/arch/sh/configs/ecovec24_defconfig index 03cb916819fa..f6f7d2e1840d 100644 --- a/arch/sh/configs/ecovec24_defconfig +++ b/arch/sh/configs/ecovec24_defconfig @@ -16,7 +16,7 @@ CONFIG_SH_ECOVEC=y CONFIG_HEARTBEAT=y CONFIG_SECCOMP=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty0, console=ttySC0,115200 root=/dev/nfs ip=dhcp mem=248M memchunk.vpu=8m memchunk.veu0=4m" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/edosk7760_defconfig b/arch/sh/configs/edosk7760_defconfig index d77f54e906fd..1ac8eb89c550 100644 --- a/arch/sh/configs/edosk7760_defconfig +++ b/arch/sh/configs/edosk7760_defconfig @@ -19,7 +19,7 @@ CONFIG_HIGH_RES_TIMERS=y CONFIG_SH_DMA=y CONFIG_SH_DMA_API=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="mem=64M console=ttySC2,115200 root=/dev/nfs rw nfsroot=192.168.0.3:/scripts/filesys ip=192.168.0.4" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/espt_defconfig b/arch/sh/configs/espt_defconfig index 2804cb760a76..1bffacbaba3d 100644 --- a/arch/sh/configs/espt_defconfig +++ b/arch/sh/configs/espt_defconfig @@ -14,7 +14,7 @@ CONFIG_MEMORY_START=0x0c000000 CONFIG_SH_ESPT=y CONFIG_SH_PCLK_FREQ=66666666 CONFIG_SECCOMP=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/nfs ip=bootp" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/j2_defconfig b/arch/sh/configs/j2_defconfig index 2eb81ebe3888..983c62e936eb 100644 --- a/arch/sh/configs/j2_defconfig +++ b/arch/sh/configs/j2_defconfig @@ -10,7 +10,7 @@ CONFIG_CPU_BIG_ENDIAN=y CONFIG_SH_DEVICE_TREE=y CONFIG_SH_JCORE_SOC=y CONFIG_HZ_100=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttyUL0 earlycon" CONFIG_BINFMT_ELF_FDPIC=y CONFIG_BINFMT_FLAT=y diff --git a/arch/sh/configs/kfr2r09-romimage_defconfig b/arch/sh/configs/kfr2r09-romimage_defconfig index 04436b4fbd76..8418c1f0c1ce 100644 --- a/arch/sh/configs/kfr2r09-romimage_defconfig +++ b/arch/sh/configs/kfr2r09-romimage_defconfig @@ -15,7 +15,7 @@ CONFIG_SH_KFR2R09=y # CONFIG_SH_TIMER_TMU is not set CONFIG_HZ_100=y CONFIG_KEXEC=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 quiet" # CONFIG_SUSPEND is not set CONFIG_NET=y diff --git a/arch/sh/configs/kfr2r09_defconfig b/arch/sh/configs/kfr2r09_defconfig index 833404490cfe..0b04d179ebba 100644 --- a/arch/sh/configs/kfr2r09_defconfig +++ b/arch/sh/configs/kfr2r09_defconfig @@ -19,7 +19,7 @@ CONFIG_NO_HZ=y CONFIG_HZ_1000=y CONFIG_KEXEC=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty0 console=ttySC1,115200" # CONFIG_SUSPEND is not set CONFIG_CPU_IDLE=y diff --git a/arch/sh/configs/lboxre2_defconfig b/arch/sh/configs/lboxre2_defconfig index 05e4ac6fed5f..498c88953d2a 100644 --- a/arch/sh/configs/lboxre2_defconfig +++ b/arch/sh/configs/lboxre2_defconfig @@ -12,7 +12,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_LBOX_RE2=y CONFIG_SH_PCLK_FREQ=40000000 CONFIG_KEXEC=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_PCCARD=y diff --git a/arch/sh/configs/microdev_defconfig b/arch/sh/configs/microdev_defconfig index e9825196dd66..8467de1d3092 100644 --- a/arch/sh/configs/microdev_defconfig +++ b/arch/sh/configs/microdev_defconfig @@ -11,7 +11,7 @@ CONFIG_SH_DMA=y CONFIG_SH_DMA_API=y CONFIG_HEARTBEAT=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/hda1" CONFIG_SUPERHYWAY=y CONFIG_NET=y diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig index 4859cd30cfc4..e43fb2a63f1f 100644 --- a/arch/sh/configs/migor_defconfig +++ b/arch/sh/configs/migor_defconfig @@ -15,7 +15,7 @@ CONFIG_NUMA=y CONFIG_SH_MIGOR=y # CONFIG_SH_TIMER_CMT is not set CONFIG_SECCOMP=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 earlyprintk=serial ip=on root=/dev/nfs ip=dhcp" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/polaris_defconfig b/arch/sh/configs/polaris_defconfig index 246408ec7462..2fc2bdc0e002 100644 --- a/arch/sh/configs/polaris_defconfig +++ b/arch/sh/configs/polaris_defconfig @@ -25,7 +25,7 @@ CONFIG_SH_DMA_API=y CONFIG_HEARTBEAT=y CONFIG_HZ_100=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 root=/dev/mtdblock2 rootfstype=jffs2 mem=63M mtdparts=physmap-flash.0:0x00100000(bootloader)ro,0x00500000(Kernel)ro,0x00A00000(Filesystem)" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/r7780mp_defconfig b/arch/sh/configs/r7780mp_defconfig index f823cc6b18f9..9e2438114890 100644 --- a/arch/sh/configs/r7780mp_defconfig +++ b/arch/sh/configs/r7780mp_defconfig @@ -20,7 +20,7 @@ CONFIG_SH_PCLK_FREQ=33333333 CONFIG_PUSH_SWITCH=y CONFIG_KEXEC=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_NET=y diff --git a/arch/sh/configs/r7785rp_defconfig b/arch/sh/configs/r7785rp_defconfig index f96bc20d4b1a..c1c92f154694 100644 --- a/arch/sh/configs/r7785rp_defconfig +++ b/arch/sh/configs/r7785rp_defconfig @@ -26,7 +26,7 @@ CONFIG_HEARTBEAT=y CONFIG_PUSH_SWITCH=y CONFIG_KEXEC=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_BINFMT_MISC=m diff --git a/arch/sh/configs/rsk7201_defconfig b/arch/sh/configs/rsk7201_defconfig index e41526120be1..65f3d695bc78 100644 --- a/arch/sh/configs/rsk7201_defconfig +++ b/arch/sh/configs/rsk7201_defconfig @@ -21,7 +21,7 @@ CONFIG_CPU_BIG_ENDIAN=y CONFIG_SH_RSK=y CONFIG_SH_PCLK_FREQ=40000000 CONFIG_HZ_1000=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ignore_loglevel" CONFIG_BINFMT_FLAT=y CONFIG_BINFMT_ZFLAT=y diff --git a/arch/sh/configs/rsk7203_defconfig b/arch/sh/configs/rsk7203_defconfig index 6af08fa1ddf8..33f608c54b85 100644 --- a/arch/sh/configs/rsk7203_defconfig +++ b/arch/sh/configs/rsk7203_defconfig @@ -26,7 +26,7 @@ CONFIG_CPU_FREQ=y CONFIG_SH_CPU_FREQ=y CONFIG_HEARTBEAT=y CONFIG_HZ_1000=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ignore_loglevel" CONFIG_BINFMT_FLAT=y CONFIG_BINFMT_ZFLAT=y diff --git a/arch/sh/configs/rts7751r2d1_defconfig b/arch/sh/configs/rts7751r2d1_defconfig index 96263a4912b7..131699a6daa7 100644 --- a/arch/sh/configs/rts7751r2d1_defconfig +++ b/arch/sh/configs/rts7751r2d1_defconfig @@ -11,7 +11,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_RTS7751R2D=y CONFIG_RTS7751R2D_1=y CONFIG_HEARTBEAT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_HOTPLUG_PCI=y diff --git a/arch/sh/configs/rts7751r2dplus_defconfig b/arch/sh/configs/rts7751r2dplus_defconfig index 92e586e6c974..ffa76ad8efaa 100644 --- a/arch/sh/configs/rts7751r2dplus_defconfig +++ b/arch/sh/configs/rts7751r2dplus_defconfig @@ -11,7 +11,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_RTS7751R2D=y CONFIG_RTS7751R2D_PLUS=y CONFIG_HEARTBEAT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_HOTPLUG_PCI=y diff --git a/arch/sh/configs/sdk7780_defconfig b/arch/sh/configs/sdk7780_defconfig index 6c719ab4332a..a33f81c41a13 100644 --- a/arch/sh/configs/sdk7780_defconfig +++ b/arch/sh/configs/sdk7780_defconfig @@ -22,7 +22,7 @@ CONFIG_SH_DMA=y CONFIG_SH_DMA_API=y CONFIG_HEARTBEAT=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="mem=128M console=tty0 console=ttySC0,115200 ip=bootp root=/dev/nfs nfsroot=192.168.0.1:/home/rootfs" CONFIG_PCI=y CONFIG_PCI_DEBUG=y diff --git a/arch/sh/configs/sdk7786_defconfig b/arch/sh/configs/sdk7786_defconfig index f776a1d0d277..1daf3dbffc16 100644 --- a/arch/sh/configs/sdk7786_defconfig +++ b/arch/sh/configs/sdk7786_defconfig @@ -70,7 +70,7 @@ CONFIG_HOTPLUG_CPU=y CONFIG_PREEMPT=y CONFIG_INTC_USERIMASK=y CONFIG_INTC_BALANCING=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200 root=/dev/sda1 nmi_debug=state,debounce rootdelay=5 pmb=iomap ignore_loglevel" CONFIG_PCI=y CONFIG_PCIEPORTBUS=y diff --git a/arch/sh/configs/se7206_defconfig b/arch/sh/configs/se7206_defconfig index 315b04a8dd2f..c729ddb5d2c8 100644 --- a/arch/sh/configs/se7206_defconfig +++ b/arch/sh/configs/se7206_defconfig @@ -36,7 +36,7 @@ CONFIG_SH_CPU_FREQ=y CONFIG_HEARTBEAT=y CONFIG_HZ_1000=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC3,115200 ignore_loglevel earlyprintk=serial" CONFIG_BINFMT_FLAT=y CONFIG_BINFMT_ZFLAT=y diff --git a/arch/sh/configs/se7343_defconfig b/arch/sh/configs/se7343_defconfig index 5d6c19338ebf..32fedfd8ae81 100644 --- a/arch/sh/configs/se7343_defconfig +++ b/arch/sh/configs/se7343_defconfig @@ -17,7 +17,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_7343_SOLUTION_ENGINE=y # CONFIG_SH_TIMER_CMT is not set CONFIG_HEARTBEAT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/se7712_defconfig b/arch/sh/configs/se7712_defconfig index ee6d28ae08de..02a8dcb898db 100644 --- a/arch/sh/configs/se7712_defconfig +++ b/arch/sh/configs/se7712_defconfig @@ -22,7 +22,7 @@ CONFIG_SH_SOLUTION_ENGINE=y CONFIG_SH_PCLK_FREQ=66666666 CONFIG_HEARTBEAT=y CONFIG_PREEMPT_VOLUNTARY=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/se7721_defconfig b/arch/sh/configs/se7721_defconfig index bad921bc10f8..a0ce6eca3bf5 100644 --- a/arch/sh/configs/se7721_defconfig +++ b/arch/sh/configs/se7721_defconfig @@ -22,7 +22,7 @@ CONFIG_SH_7721_SOLUTION_ENGINE=y CONFIG_SH_PCLK_FREQ=33333333 CONFIG_HEARTBEAT=y CONFIG_PREEMPT_VOLUNTARY=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda2" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/se7724_defconfig b/arch/sh/configs/se7724_defconfig index a26f7f1841c7..9cd50acd959d 100644 --- a/arch/sh/configs/se7724_defconfig +++ b/arch/sh/configs/se7724_defconfig @@ -17,7 +17,7 @@ CONFIG_SH_DMA_API=y CONFIG_HEARTBEAT=y CONFIG_SECCOMP=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=tty1 console=ttySC3,115200 root=/dev/nfs ip=dhcp memchunk.vpu=4m" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/se7751_defconfig b/arch/sh/configs/se7751_defconfig index 4a024065bb75..8c2beb3677e2 100644 --- a/arch/sh/configs/se7751_defconfig +++ b/arch/sh/configs/se7751_defconfig @@ -12,7 +12,7 @@ CONFIG_MEMORY_START=0x0c000000 CONFIG_FLATMEM_MANUAL=y CONFIG_SH_7751_SOLUTION_ENGINE=y CONFIG_HEARTBEAT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,38400" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/se7780_defconfig b/arch/sh/configs/se7780_defconfig index dcd85b858ac8..3be23f65c38e 100644 --- a/arch/sh/configs/se7780_defconfig +++ b/arch/sh/configs/se7780_defconfig @@ -14,7 +14,7 @@ CONFIG_MEMORY_SIZE=0x08000000 CONFIG_SH_7780_SOLUTION_ENGINE=y CONFIG_SH_PCLK_FREQ=33333333 CONFIG_HEARTBEAT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/sda1" CONFIG_PCI=y CONFIG_NET=y diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig index ff502683132e..87e9805b76d0 100644 --- a/arch/sh/configs/sh03_defconfig +++ b/arch/sh/configs/sh03_defconfig @@ -16,7 +16,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_SH03=y CONFIG_HEARTBEAT=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 mem=64M root=/dev/nfs" CONFIG_PCI=y CONFIG_HOTPLUG_PCI=y diff --git a/arch/sh/configs/sh2007_defconfig b/arch/sh/configs/sh2007_defconfig index 99975db461d8..8e92c58316db 100644 --- a/arch/sh/configs/sh2007_defconfig +++ b/arch/sh/configs/sh2007_defconfig @@ -20,7 +20,7 @@ CONFIG_SH_DMA=y CONFIG_SH_DMA_API=y CONFIG_NR_DMA_CHANNELS_BOOL=y CONFIG_HZ_100=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/rootfs,rsize=1024,wsize=1024 earlyprintk=sh-sci.1" CONFIG_PCCARD=y CONFIG_BINFMT_MISC=y diff --git a/arch/sh/configs/sh7757lcr_defconfig b/arch/sh/configs/sh7757lcr_defconfig index a2700ab165af..a15877daff16 100644 --- a/arch/sh/configs/sh7757lcr_defconfig +++ b/arch/sh/configs/sh7757lcr_defconfig @@ -21,7 +21,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_SH_SH7757LCR=y CONFIG_HEARTBEAT=y CONFIG_SECCOMP=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC2,115200 root=/dev/nfs ip=dhcp" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/sh7763rdp_defconfig b/arch/sh/configs/sh7763rdp_defconfig index 8a6a446f9eb8..351ccabac8a6 100644 --- a/arch/sh/configs/sh7763rdp_defconfig +++ b/arch/sh/configs/sh7763rdp_defconfig @@ -14,7 +14,7 @@ CONFIG_MEMORY_START=0x0c000000 CONFIG_SH_SH7763RDP=y CONFIG_SH_PCLK_FREQ=66666666 CONFIG_SECCOMP=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC2,115200 root=/dev/sda1 rootdelay=10" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/configs/shmin_defconfig b/arch/sh/configs/shmin_defconfig index c0b6f40d01cc..7cc8725951f5 100644 --- a/arch/sh/configs/shmin_defconfig +++ b/arch/sh/configs/shmin_defconfig @@ -18,7 +18,7 @@ CONFIG_FLATMEM_MANUAL=y # CONFIG_SH_ADC is not set CONFIG_SH_SHMIN=y CONFIG_SH_PCLK_FREQ=32000000 -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,115200 root=1f01 mtdparts=phys_mapped_flash:64k(firm)ro,-(sys) netdev=34,0x300,eth0 " CONFIG_NET=y CONFIG_UNIX=y diff --git a/arch/sh/configs/shx3_defconfig b/arch/sh/configs/shx3_defconfig index 32ec6eb1eabc..36cac3067cef 100644 --- a/arch/sh/configs/shx3_defconfig +++ b/arch/sh/configs/shx3_defconfig @@ -47,7 +47,7 @@ CONFIG_KEXEC=y CONFIG_SECCOMP=y CONFIG_SMP=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=bios ignore_loglevel" CONFIG_BINFMT_MISC=y CONFIG_NET=y diff --git a/arch/sh/configs/titan_defconfig b/arch/sh/configs/titan_defconfig index ba887f1351be..5aa513d54df0 100644 --- a/arch/sh/configs/titan_defconfig +++ b/arch/sh/configs/titan_defconfig @@ -20,7 +20,7 @@ CONFIG_SH_PCLK_FREQ=30000000 CONFIG_SH_DMA=y CONFIG_SH_DMA_API=y CONFIG_PREEMPT_VOLUNTARY=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC1,38400N81 root=/dev/nfs ip=:::::eth1:autoconf rw" CONFIG_PCI=y CONFIG_HOTPLUG_PCI=y diff --git a/arch/sh/configs/ul2_defconfig b/arch/sh/configs/ul2_defconfig index 103b81ec1ffb..8d8b6787302f 100644 --- a/arch/sh/configs/ul2_defconfig +++ b/arch/sh/configs/ul2_defconfig @@ -18,7 +18,7 @@ CONFIG_HIGH_RES_TIMERS=y CONFIG_HZ_100=y CONFIG_KEXEC=y CONFIG_PREEMPT=y -CONFIG_CMDLINE_OVERWRITE=y +CONFIG_CMDLINE_FORCE=y CONFIG_CMDLINE="console=ttySC0,115200 root=/dev/nfs ip=dhcp" CONFIG_NET=y CONFIG_PACKET=y diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 4144be650d41..464ccbbd8205 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -306,15 +307,7 @@ void __init setup_arch(char **cmdline_p) bss_resource.start = virt_to_phys(__bss_start); bss_resource.end = virt_to_phys(__bss_stop)-1; -#ifdef CONFIG_CMDLINE_OVERWRITE - strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line)); -#else - strlcpy(command_line, COMMAND_LINE, sizeof(command_line)); -#ifdef CONFIG_CMDLINE_EXTEND - strlcat(command_line, " ", sizeof(command_line)); - strlcat(command_line, CONFIG_CMDLINE, sizeof(command_line)); -#endif -#endif + cmdline_build(command_line, COMMAND_LINE); /* Save unparsed command line copy for /proc/cmdline */ memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); From patchwork Fri Apr 2 15:18:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09D52C433B4 for ; Fri, 2 Apr 2021 15:23:17 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A06B2610E8 for ; Fri, 2 Apr 2021 15:23:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A06B2610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z4WMJXFf34iKZY6vMQlCL9sB4C23qJxCrJQwH47gAfA=; b=UvPCyg82XYfJVdI9i9F025da8p VFDAri7n5nnlBKgxZsaNWKoMahQ0wpPjpyzL1A/aZvKBG+BQ0ldQEmCu4+MJnfdLlxJZN7Bqf+ECf gnT97L0B0yXX+uhF1tDgq7ID9Cw2n63Q+Pv/KcXkCU1VrZvTM79SFdZNxw2Y9acbCiOOMBgpEPcq/ 9fpzLdXJjYsBRj4MBN1f26YPQ4Ue16hSenZ1Z7GD0pzwZVzoGTLegksl/ED0+/va3xmMCc5gRXiLu 9Pq24m5obfN6p4TbOiExiSzSexaxUNzRNADgawIuvWEtoQDkB2fi5Z1YnBkOxGHVTOJpWRgF0LwPc vQ6YFwqA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLdd-00DG8A-HF; Fri, 02 Apr 2021 15:23:09 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYy-00DCTw-0M; Fri, 02 Apr 2021 15:18:22 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG13TDmz9v2mD; Fri, 2 Apr 2021 17:18:17 +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 F6l6AA6-Funv; Fri, 2 Apr 2021 17:18:17 +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 4FBkG11sggz9v2ls; Fri, 2 Apr 2021 17:18:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1BFC78BB7C; Fri, 2 Apr 2021 17:18:19 +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 EfU0KCsncQUw; Fri, 2 Apr 2021 17:18:19 +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 9978B8BB79; Fri, 2 Apr 2021 17:18:18 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 3721D67989; Fri, 2 Apr 2021 15:18:18 +0000 (UTC) Message-Id: <37fc5bd333125270f7032b8f9be225297e6dbe4f.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 16/20] sparc: 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:18 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161821_161431_33089533 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/sparc/Kconfig | 18 +----------------- arch/sparc/prom/bootstr_64.c | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 164a5254c91c..2a197f3a2549 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -50,6 +50,7 @@ config SPARC select NEED_DMA_MAP_STATE select NEED_SG_DMA_LENGTH select SET_FS + select GENERIC_CMDLINE if SPARC64 config SPARC32 def_bool !64BIT @@ -313,23 +314,6 @@ config SCHED_MC making when dealing with multi-core CPU chips at a cost of slightly increased overhead in some places. If unsure say N here. -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - depends on SPARC64 - -config CMDLINE - string "Initial kernel command string" - depends on CMDLINE_BOOL - default "console=ttyS0,9600 root=/dev/sda1" - help - Say Y here if you want to be able to pass default arguments to - the kernel. This will be overridden by the bootloader, if you - use one (such as SILO). This is most useful if you want to boot - a kernel from TFTP, and want default options to be available - with having them passed on the command line. - - NOTE: This option WILL override the PROM bootargs setting! - config SUN_PM bool default y if SPARC32 diff --git a/arch/sparc/prom/bootstr_64.c b/arch/sparc/prom/bootstr_64.c index f1cc34d99eec..4853a45b3de9 100644 --- a/arch/sparc/prom/bootstr_64.c +++ b/arch/sparc/prom/bootstr_64.c @@ -25,7 +25,7 @@ struct { char bootstr_buf[BARG_LEN]; } bootstr_info = { .bootstr_len = BARG_LEN, -#ifdef CONFIG_CMDLINE +#if CONFIG_CMDLINE != "" .bootstr_valid = 1, .bootstr_buf = CONFIG_CMDLINE, #endif From patchwork Fri Apr 2 15:18:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF850C433ED for ; Fri, 2 Apr 2021 15:24:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CC66610E8 for ; Fri, 2 Apr 2021 15:24:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CC66610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ef6EtAVVOF+krLk04RFnRdS1PigPf6s/E2327dvr7kc=; b=cIx7cFQ5C/8axgrTKco2V+dC3/ NYjJnHsoWhRsGhQ2qLKCr1/zcoM14O1SqS9TU4doKLrO7r0XQW7FkhVhgHXjl5OJq8iSGWEj7a2zB 2/dCeWzb1oGsXAoOWbU5tKaBTJtcav0zWB4MK9KcvkJq4R271NI56pNmSwiSO7Hc0ULgrZ51nRqa3 wVgXfwfnKZlDmeZfaZJQ8kBxjKNnCeuA6T+YF9nJlW7We2qH+2lQl/XKefHZOqiYkpDnnFh8DPImF Bzy4gUX/hGYBKNgqMWcm+TAZxpos3gLvp7xDrhtOoU7haqpLKmJUGYrHnydlCGAJvZXvZZkllhtd9 3FMpy0TA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLea-00DGg3-0x; Fri, 02 Apr 2021 15:24:08 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYz-00DCTx-4w; Fri, 02 Apr 2021 15:18:23 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG25GKzz9v2mG; Fri, 2 Apr 2021 17:18:18 +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 Fa98FSt8wZGD; Fri, 2 Apr 2021 17:18:18 +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 4FBkG24Cgkz9v2mF; Fri, 2 Apr 2021 17:18:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 30F038BB7F; Fri, 2 Apr 2021 17:18:20 +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 HQzlnfTPkzN2; 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 611E98BB79; Fri, 2 Apr 2021 17:18:19 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 3D03167989; Fri, 2 Apr 2021 15:18:19 +0000 (UTC) Message-Id: <61707011a81a365ccc22a6374f797b6f63cf5030.1617375802.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 17/20] xtensa: 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:19 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161821_374203_80D21875 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/xtensa/Kconfig | 15 +-------------- arch/xtensa/configs/audio_kc705_defconfig | 1 - arch/xtensa/configs/common_defconfig | 1 - arch/xtensa/configs/generic_kc705_defconfig | 1 - arch/xtensa/configs/iss_defconfig | 1 - arch/xtensa/configs/nommu_kc705_defconfig | 1 - arch/xtensa/configs/smp_lx200_defconfig | 1 - arch/xtensa/configs/virt_defconfig | 1 - arch/xtensa/configs/xip_kc705_defconfig | 1 - arch/xtensa/kernel/setup.c | 10 ++-------- 10 files changed, 3 insertions(+), 30 deletions(-) diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 9ad6b7b82707..42309f5e9cda 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -16,6 +16,7 @@ config XTENSA select COMMON_CLK select DMA_REMAP if MMU select GENERIC_ATOMIC64 + select GENERIC_CMDLINE select GENERIC_IRQ_SHOW select GENERIC_PCI_IOMAP select GENERIC_SCHED_CLOCK @@ -353,20 +354,6 @@ config GENERIC_CALIBRATE_DELAY help The BogoMIPS value can easily be derived from the CPU frequency. -config CMDLINE_BOOL - bool "Default bootloader kernel arguments" - -config CMDLINE - string "Initial kernel command string" - depends on CMDLINE_BOOL - default "console=ttyS0,38400 root=/dev/ram" - help - On some architectures (EBSA110 and CATS), there is currently no way - for the boot loader to pass arguments to the kernel. For these - architectures, you should supply some command-line options at build - time by entering them here. As a minimum, you should specify the - memory size and the root device (e.g., mem=64M root=/dev/nfs). - config USE_OF bool "Flattened Device Tree support" select OF diff --git a/arch/xtensa/configs/audio_kc705_defconfig b/arch/xtensa/configs/audio_kc705_defconfig index 3be62da8089b..5f8661a33ab4 100644 --- a/arch/xtensa/configs/audio_kc705_defconfig +++ b/arch/xtensa/configs/audio_kc705_defconfig @@ -27,7 +27,6 @@ CONFIG_PREEMPT=y CONFIG_HIGHMEM=y # CONFIG_PCI is not set CONFIG_XTENSA_PLATFORM_XTFPGA=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="kc705" diff --git a/arch/xtensa/configs/common_defconfig b/arch/xtensa/configs/common_defconfig index fa9389869154..6467ebcbb080 100644 --- a/arch/xtensa/configs/common_defconfig +++ b/arch/xtensa/configs/common_defconfig @@ -6,7 +6,6 @@ CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_XTENSA_PLATFORM_XT2000=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,38400 ip=bootp root=nfs nfsroot=/opt/montavista/pro/devkit/xtensa/linux_be/target memmap=128M@0" CONFIG_BINFMT_MISC=y CONFIG_NET=y diff --git a/arch/xtensa/configs/generic_kc705_defconfig b/arch/xtensa/configs/generic_kc705_defconfig index e9d6b6f6eca1..8984c4e68a42 100644 --- a/arch/xtensa/configs/generic_kc705_defconfig +++ b/arch/xtensa/configs/generic_kc705_defconfig @@ -26,7 +26,6 @@ CONFIG_PREEMPT=y CONFIG_HIGHMEM=y # CONFIG_PCI is not set CONFIG_XTENSA_PLATFORM_XTFPGA=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="kc705" diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig index 32ce8fb068f0..996ad115264d 100644 --- a/arch/xtensa/configs/iss_defconfig +++ b/arch/xtensa/configs/iss_defconfig @@ -2,7 +2,6 @@ CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_EXPERT=y # CONFIG_PCI is not set -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,38400 eth0=tuntap,,tap0 ip=192.168.168.5:192.168.168.1 root=nfs nfsroot=192.168.168.1:/opt/montavista/pro/devkit/xtensa/linux_be/target memmap=128M@0" # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_NET=y diff --git a/arch/xtensa/configs/nommu_kc705_defconfig b/arch/xtensa/configs/nommu_kc705_defconfig index 88b2e222d4bf..54250bc74885 100644 --- a/arch/xtensa/configs/nommu_kc705_defconfig +++ b/arch/xtensa/configs/nommu_kc705_defconfig @@ -33,7 +33,6 @@ CONFIG_PREEMPT=y CONFIG_MEMMAP_CACHEATTR=0xfff2442f # CONFIG_PCI is not set CONFIG_XTENSA_PLATFORM_XTFPGA=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=256M@0x60000000" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="kc705_nommu" diff --git a/arch/xtensa/configs/smp_lx200_defconfig b/arch/xtensa/configs/smp_lx200_defconfig index a47c85638ec1..58b284fd627f 100644 --- a/arch/xtensa/configs/smp_lx200_defconfig +++ b/arch/xtensa/configs/smp_lx200_defconfig @@ -30,7 +30,6 @@ CONFIG_HOTPLUG_CPU=y # CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is not set # CONFIG_PCI is not set CONFIG_XTENSA_PLATFORM_XTFPGA=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=96M@0" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="lx200mx" diff --git a/arch/xtensa/configs/virt_defconfig b/arch/xtensa/configs/virt_defconfig index 6d1387dfa96f..fb4dce2c70a3 100644 --- a/arch/xtensa/configs/virt_defconfig +++ b/arch/xtensa/configs/virt_defconfig @@ -21,7 +21,6 @@ CONFIG_XTENSA_VARIANT_DC233C=y CONFIG_XTENSA_UNALIGNED_USER=y CONFIG_XTENSA_KSEG_512M=y CONFIG_HIGHMEM=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x80000000@0" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="virt" diff --git a/arch/xtensa/configs/xip_kc705_defconfig b/arch/xtensa/configs/xip_kc705_defconfig index 4f1ff9531f6a..ae4427773af2 100644 --- a/arch/xtensa/configs/xip_kc705_defconfig +++ b/arch/xtensa/configs/xip_kc705_defconfig @@ -26,7 +26,6 @@ CONFIG_KERNEL_LOAD_ADDRESS=0xf6000000 CONFIG_XTENSA_KSEG_512M=y CONFIG_HIGHMEM=y CONFIG_XTENSA_PLATFORM_XTFPGA=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0" CONFIG_USE_OF=y CONFIG_BUILTIN_DTB_SOURCE="kc705" diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index ed184106e4cf..ebb009f112a5 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -25,6 +25,7 @@ #include #include #include +#include #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) # include @@ -73,10 +74,6 @@ extern unsigned long loops_per_jiffy; static char __initdata command_line[COMMAND_LINE_SIZE]; -#ifdef CONFIG_CMDLINE_BOOL -static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; -#endif - #ifdef CONFIG_PARSE_BOOTPARAM /* * Boot parameter parsing. @@ -257,10 +254,7 @@ void __init init_arch(bp_tag_t *bp_start) early_init_devtree(dtb_start); #endif -#ifdef CONFIG_CMDLINE_BOOL - if (!command_line[0]) - strlcpy(command_line, default_command_line, COMMAND_LINE_SIZE); -#endif + cmdline_build(command_line, command_line); /* Early hook for platforms */ From patchwork Fri Apr 2 15:18:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 631C3C43460 for ; Fri, 2 Apr 2021 15:24:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDCF3610E8 for ; Fri, 2 Apr 2021 15:24:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDCF3610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xqJo/UfZfrP5PFtqev9zEfVFiuZsW7KsIX+0t2VPAf4=; b=TpNS35cRgFcyRdoh8FrtkCRY83 kclBzJPEfAHxRDjVHnSZDQtTOBVNIURdjaVQvGVR9PPdJK7lgmfabzU4yEKg9bO6DoTml22Fz45X6 mA6LzrxKC2nVeWiMWcSP1noEuCdm0WC/ZuaoJEr0Yq2/vqtgQV6JXqIDNl0dcfRtjNvhCqBcodaHd HMKYSyUmhaByyYfMVkeRCwEZi1nkIIBSeusv4jZF+7FKinEWrRnWKkNLLAmV6dNS5L11StSranfRL nLFx8LkyEwKooUREc6WemUbloo4qeGpVA4DV0Cl5VLceAhxclCp6+3Mj2XkCESmST0yqhQV59K952 2NHnE2Mg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLee-00DGhe-Ip; Fri, 02 Apr 2021 15:24:12 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLYz-00DCUX-KX; Fri, 02 Apr 2021 15:18:24 +0000 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161821_751226_73441117 X-CRM114-Status: GOOD ( 18.02 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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; From patchwork Fri Apr 2 15:18:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17828C433B4 for ; Fri, 2 Apr 2021 15:25:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D2EF610E8 for ; Fri, 2 Apr 2021 15:25:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D2EF610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4H8O6Vearstzf1P0tFMM6XZpn+44Lb9YWGGuFDgmh9E=; b=OmutO3gMxrE7BBiZyTXuBxq58/ 6rb4k6+Kt+Lo373JCya2uslbzgGiH4EGxy8Y/RYnUINXswTtISorC+0b3n+M/XoOoiwqEg2+5FPwy BMH3ln7Kp427VU9fBmg7F2pf/S/70fAncmM7X1/qv/Z1I+Hbbca26wOkC21z1tBJK82orDNKwGB1h 4L5XyMS1UGD7P6KNWNDj/ubDq/LVlfR+qVz4dDWc8758rIjVbPGv0hbD//e9gZ1QmRhduIFcAUQjR kz9M5Hq3i5OUcWvVZG5kv8MUZ7ml3b1R1b3m916mP38l8oWGLdXjN0iBjPo30ok+hYPBEv3Lg4K0C MoWR7+3Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLfq-00DHnK-Ml; Fri, 02 Apr 2021 15:25:26 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZ1-00DCUq-1Y; Fri, 02 Apr 2021 15:18:26 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG44gBbz9v2m7; Fri, 2 Apr 2021 17:18:20 +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 sBnAWcx1Go7E; Fri, 2 Apr 2021 17:18:20 +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 4FBkG43Nc3z9v2ls; Fri, 2 Apr 2021 17:18:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 12BCB8BB7C; Fri, 2 Apr 2021 17:18:22 +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 mdOU6-fT9Uo6; Fri, 2 Apr 2021 17:18:21 +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 71E4F8BB7F; Fri, 2 Apr 2021 17:18:21 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 4E3F867989; Fri, 2 Apr 2021 15:18:21 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 19/20] mips: 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:21 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161824_445420_A42FD5CB X-CRM114-Status: GOOD ( 18.27 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org This converts the architecture to GENERIC_CMDLINE. Signed-off-by: Christophe Leroy --- arch/mips/Kconfig | 1 + arch/mips/Kconfig.debug | 44 ----------------------- arch/mips/configs/ar7_defconfig | 1 - arch/mips/configs/bcm47xx_defconfig | 1 - arch/mips/configs/bcm63xx_defconfig | 1 - arch/mips/configs/bmips_be_defconfig | 1 - arch/mips/configs/bmips_stb_defconfig | 1 - arch/mips/configs/capcella_defconfig | 1 - arch/mips/configs/ci20_defconfig | 1 - arch/mips/configs/cu1000-neo_defconfig | 1 - arch/mips/configs/cu1830-neo_defconfig | 1 - arch/mips/configs/e55_defconfig | 1 - arch/mips/configs/generic_defconfig | 1 - arch/mips/configs/gpr_defconfig | 1 - arch/mips/configs/loongson3_defconfig | 1 - arch/mips/configs/mpc30x_defconfig | 1 - arch/mips/configs/rt305x_defconfig | 1 - arch/mips/configs/tb0219_defconfig | 1 - arch/mips/configs/tb0226_defconfig | 1 - arch/mips/configs/tb0287_defconfig | 1 - arch/mips/configs/workpad_defconfig | 1 - arch/mips/configs/xway_defconfig | 1 - arch/mips/kernel/relocate.c | 4 +-- arch/mips/kernel/setup.c | 40 ++------------------- arch/mips/pic32/pic32mzda/early_console.c | 2 +- arch/mips/pic32/pic32mzda/init.c | 2 -- 26 files changed, 5 insertions(+), 108 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d89efba3d8a4..a65ce9ddbfce 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -24,6 +24,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 diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index 7a8d94cdd493..b5a099c74eb6 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug @@ -30,50 +30,6 @@ config EARLY_PRINTK_8250 config USE_GENERIC_EARLY_PRINTK_8250 bool -config CMDLINE_BOOL - bool "Built-in kernel command line" - help - For most systems, it is firmware or second stage bootloader that - by default specifies the kernel command line options. However, - it might be necessary or advantageous to either override the - default kernel command line or add a few extra options to it. - For such cases, this option allows you to hardcode your own - command line options directly into the kernel. For that, you - should choose 'Y' here, and fill in the extra boot arguments - in CONFIG_CMDLINE. - - The built-in options will be concatenated to the default command - line if CMDLINE_OVERRIDE is set to 'N'. Otherwise, the default - command line will be ignored and replaced by the built-in string. - - Most MIPS systems will normally expect 'N' here and rely upon - the command line from the firmware or the second-stage bootloader. - -config CMDLINE - string "Default kernel command string" - depends on CMDLINE_BOOL - help - On some platforms, there is currently no way for the boot loader to - pass arguments to the kernel. For these platforms, and for the cases - when you want to add some extra options to the command line or ignore - the default command line, you can supply some command-line options at - build time by entering them here. In other cases you can specify - kernel args so that you don't have to set them up in board prom - initialization routines. - - For more information, see the CMDLINE_BOOL and CMDLINE_OVERRIDE - options. - -config CMDLINE_OVERRIDE - bool "Built-in command line overrides firmware arguments" - depends on CMDLINE_BOOL - help - By setting this option to 'Y' you will have your kernel ignore - command line arguments from firmware or second stage bootloader. - Instead, the built-in command line will be used exclusively. - - Normally, you will choose 'N' here. - config SB1XXX_CORELIS bool "Corelis Debugger" depends on SIBYTE_SB1xxx_SOC diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig index cf9c6329b807..5e8adcd799d0 100644 --- a/arch/mips/configs/ar7_defconfig +++ b/arch/mips/configs/ar7_defconfig @@ -120,5 +120,4 @@ CONFIG_SQUASHFS=y # 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" diff --git a/arch/mips/configs/bcm47xx_defconfig b/arch/mips/configs/bcm47xx_defconfig index 91ce75edbfb4..690f423509f0 100644 --- a/arch/mips/configs/bcm47xx_defconfig +++ b/arch/mips/configs/bcm47xx_defconfig @@ -77,5 +77,4 @@ 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" diff --git a/arch/mips/configs/bcm63xx_defconfig b/arch/mips/configs/bcm63xx_defconfig index 861f680184b9..19b15424f669 100644 --- a/arch/mips/configs/bcm63xx_defconfig +++ b/arch/mips/configs/bcm63xx_defconfig @@ -65,5 +65,4 @@ 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" diff --git a/arch/mips/configs/bmips_be_defconfig b/arch/mips/configs/bmips_be_defconfig index 032bb51defe8..2db7712acc5d 100644 --- a/arch/mips/configs/bmips_be_defconfig +++ b/arch/mips/configs/bmips_be_defconfig @@ -75,5 +75,4 @@ CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon" diff --git a/arch/mips/configs/bmips_stb_defconfig b/arch/mips/configs/bmips_stb_defconfig index 625bd2d7e685..bc1659d43ca7 100644 --- a/arch/mips/configs/bmips_stb_defconfig +++ b/arch/mips/configs/bmips_stb_defconfig @@ -86,5 +86,4 @@ CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="earlycon" diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig index 7bf8971af53b..300032a5caa0 100644 --- a/arch/mips/configs/capcella_defconfig +++ b/arch/mips/configs/capcella_defconfig @@ -87,5 +87,4 @@ CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_HW is not set -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="mem=32M console=ttyVR0,38400" diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig index ab7ebb066834..f874e421b54f 100644 --- a/arch/mips/configs/ci20_defconfig +++ b/arch/mips/configs/ci20_defconfig @@ -203,5 +203,4 @@ 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" diff --git a/arch/mips/configs/cu1000-neo_defconfig b/arch/mips/configs/cu1000-neo_defconfig index 9d75f5b77d5d..03cb524967e7 100644 --- a/arch/mips/configs/cu1000-neo_defconfig +++ b/arch/mips/configs/cu1000-neo_defconfig @@ -123,5 +123,4 @@ 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" diff --git a/arch/mips/configs/cu1830-neo_defconfig b/arch/mips/configs/cu1830-neo_defconfig index 29decd0003c6..d733ccab494e 100644 --- a/arch/mips/configs/cu1830-neo_defconfig +++ b/arch/mips/configs/cu1830-neo_defconfig @@ -126,5 +126,4 @@ 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" diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig index fd82b858a8f0..ffc964d1bae7 100644 --- a/arch/mips/configs/e55_defconfig +++ b/arch/mips/configs/e55_defconfig @@ -33,5 +33,4 @@ CONFIG_AUTOFS4_FS=y CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x1f0,0x3f6,40 mem=8M" diff --git a/arch/mips/configs/generic_defconfig b/arch/mips/configs/generic_defconfig index 714169e411cf..6003f6c7aa09 100644 --- a/arch/mips/configs/generic_defconfig +++ b/arch/mips/configs/generic_defconfig @@ -88,5 +88,4 @@ 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" diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig index 5cb91509bb7c..8998d28b94c8 100644 --- a/arch/mips/configs/gpr_defconfig +++ b/arch/mips/configs/gpr_defconfig @@ -306,5 +306,4 @@ 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" diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig index 0e79f81217bc..c4f9a236bd1f 100644 --- a/arch/mips/configs/loongson3_defconfig +++ b/arch/mips/configs/loongson3_defconfig @@ -408,5 +408,4 @@ CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set # CONFIG_DEBUG_PREEMPT is not set # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="ieee754=relaxed" diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig index d4e038802510..6ecef2a666fc 100644 --- a/arch/mips/configs/mpc30x_defconfig +++ b/arch/mips/configs/mpc30x_defconfig @@ -49,5 +49,4 @@ CONFIG_AUTOFS4_FS=y CONFIG_PROC_KCORE=y CONFIG_CONFIGFS_FS=m CONFIG_NFS_FS=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="mem=32M console=ttyVR0,19200 ide0=0x170,0x376,73" diff --git a/arch/mips/configs/rt305x_defconfig b/arch/mips/configs/rt305x_defconfig index fec5851c164b..c34441ce6621 100644 --- a/arch/mips/configs/rt305x_defconfig +++ b/arch/mips/configs/rt305x_defconfig @@ -147,4 +147,3 @@ CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y diff --git a/arch/mips/configs/tb0219_defconfig b/arch/mips/configs/tb0219_defconfig index 6547f84750b5..ccf20bd156a1 100644 --- a/arch/mips/configs/tb0219_defconfig +++ b/arch/mips/configs/tb0219_defconfig @@ -73,5 +73,4 @@ CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NFSD=y CONFIG_NFSD_V3=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs" diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig index 7e099f7c2286..9f78fd00a4f6 100644 --- a/arch/mips/configs/tb0226_defconfig +++ b/arch/mips/configs/tb0226_defconfig @@ -68,5 +68,4 @@ CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NFSD=m CONFIG_NFSD_V3=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="cca=3 mem=32M console=ttyVR0,115200" diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig index 0d881dd862c0..5529d0dacf94 100644 --- a/arch/mips/configs/tb0287_defconfig +++ b/arch/mips/configs/tb0287_defconfig @@ -81,5 +81,4 @@ CONFIG_NFSD_V3=y CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs" diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig index 891a5f77305d..ee712f7b5575 100644 --- a/arch/mips/configs/workpad_defconfig +++ b/arch/mips/configs/workpad_defconfig @@ -61,5 +61,4 @@ CONFIG_TMPFS_POSIX_ACL=y CONFIG_NFS_FS=m CONFIG_NFSD=m CONFIG_NFSD_V3=y -CONFIG_CMDLINE_BOOL=y CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x170,0x376,49 mem=16M" diff --git a/arch/mips/configs/xway_defconfig b/arch/mips/configs/xway_defconfig index 9abbc0debc2a..ebd8dbdb0695 100644 --- a/arch/mips/configs/xway_defconfig +++ b/arch/mips/configs/xway_defconfig @@ -153,4 +153,3 @@ CONFIG_DEBUG_FS=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHED_DEBUG is not set # CONFIG_FTRACE is not set -CONFIG_CMDLINE_BOOL=y diff --git a/arch/mips/kernel/relocate.c b/arch/mips/kernel/relocate.c index 499a5357c09f..13c955027696 100644 --- a/arch/mips/kernel/relocate.c +++ b/arch/mips/kernel/relocate.c @@ -244,15 +244,13 @@ static inline __init unsigned long get_random_boot(void) static inline __init bool kaslr_disabled(void) { char *str; - -#if defined(CONFIG_CMDLINE_BOOL) const char *builtin_cmdline = CONFIG_CMDLINE; 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) == ' ')) return true; diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 279be0153f8b..f2270528011b 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -66,12 +67,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. @@ -546,28 +541,6 @@ 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)) { - strlcpy(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)) - strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); - else - boot_command_line[0] = 0; - #ifdef CONFIG_OF_EARLY_FLATTREE /* * If we're configured to take boot arguments from DT, look for those @@ -585,16 +558,7 @@ static void __init bootcmdline_init(void) * plat_mem_setup() should have filled arcs_cmdline with arguments from * the bootloader. */ - if (IS_ENABLED(CONFIG_MIPS_CMDLINE_DTB_EXTEND) || !dt_bootargs) - 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. - */ - if (IS_ENABLED(CONFIG_CMDLINE_BOOL) && - !IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)) - bootcmdline_append(builtin_cmdline, COMMAND_LINE_SIZE); + cmdline_build(boot_command_line, arcs_cmdline); } /* diff --git a/arch/mips/pic32/pic32mzda/early_console.c b/arch/mips/pic32/pic32mzda/early_console.c index 25372e62783b..94d3a5ba5e10 100644 --- a/arch/mips/pic32/pic32mzda/early_console.c +++ b/arch/mips/pic32/pic32mzda/early_console.c @@ -75,7 +75,7 @@ static char * __init pic32_getcmdline(void) * arch_mem_init() has not been called yet, so we don't have a real * command line setup if using CONFIG_CMDLINE_BOOL. */ -#ifdef CONFIG_CMDLINE_OVERRIDE +#ifdef CONFIG_CMDLINE_FORCE return CONFIG_CMDLINE; #else return fw_getcmdline(); diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c index 764f2d022fae..39fdacbbac56 100644 --- a/arch/mips/pic32/pic32mzda/init.c +++ b/arch/mips/pic32/pic32mzda/init.c @@ -40,9 +40,7 @@ void __init plat_mem_setup(void) pr_info("Found following command lines\n"); 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); -#endif if (dtb != __dtb_start) strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); From patchwork Fri Apr 2 15:18:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 12181179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96CE7C43460 for ; Fri, 2 Apr 2021 15:25:10 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 33D906113E for ; Fri, 2 Apr 2021 15:25:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33D906113E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Date:Cc:To:Subject:From:References:In-Reply-To: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cBvDXdiuCAC8TpNQ//KY/ZqJdI5E2Rzv5VnodIg9u/s=; b=Hfy6AwH0Gpz3lV/sn2Qr6KhTCB Hjh/FmkvfBDxOb9S+p+/UG5gG8RtJ6JniIWM0TyosxQOPQCdkhaDhyPeQ2LNlWVgM03uWnk0xzCSV 11PZOWdrcup0ib6Y74GrffQap+7jHWxImGjCflcdS8yXJulukNeDgnHB881pr/ksaaBvj7E36iAoK fTRAv2NzL6JJL1CObVLYTiPxAwUtX4oCPx+tNcrVTgWBKVa+8ukNdUJKJZkWaztyJnZqQoXOql857 aH5BWBDbm7Y4m6MHPuNEzEM5xqSiP0lHRf4qJQqYwhoBNdmxYPia8sSS8Ev5j8zuc4DkaB9+NBoKC fyn17MQQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lSLfL-00DHUb-NP; Fri, 02 Apr 2021 15:24:55 +0000 Received: from pegase1.c-s.fr ([93.17.236.30]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lSLZ1-00DCUv-NI; Fri, 02 Apr 2021 15:18:25 +0000 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4FBkG52l3Hz9v2lx; Fri, 2 Apr 2021 17:18:21 +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 GzDR9N0g0Rpg; Fri, 2 Apr 2021 17:18:21 +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 4FBkG519y8z9v2ls; Fri, 2 Apr 2021 17:18:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F0A0F8BB7C; Fri, 2 Apr 2021 17:18:22 +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 JBXhU7_Qtg1N; Fri, 2 Apr 2021 17:18:22 +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 789078BB7D; Fri, 2 Apr 2021 17:18:22 +0200 (CEST) Received: by po16121vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 5513E67989; Fri, 2 Apr 2021 15:18:22 +0000 (UTC) Message-Id: <349128c2baa37dfcafb61a10d4e6c62f93cfe881.1617375803.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 20/20] cmdline: Remove CONFIG_CMDLINE_EXTEND 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:22 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210402_161824_421426_F9A5CF14 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org All architectures providing CONFIG_CMDLINE_EXTEND are now converted to GENERIC_CMDLINE. This configuration item is not used anymore, drop it. Signed-off-by: Christophe Leroy --- include/linux/cmdline.h | 2 +- init/Kconfig | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h index a0773dc365c7..020028e2bdf0 100644 --- a/include/linux/cmdline.h +++ b/include/linux/cmdline.h @@ -36,7 +36,7 @@ static __always_inline bool __cmdline_build(char *dst, const char *src) len = cmdline_strlcat(dst, src, COMMAND_LINE_SIZE); - if (IS_ENABLED(CONFIG_CMDLINE_EXTEND)) + if (IS_ENABLED(CONFIG_CMDLINE_APPEND)) len = cmdline_strlcat(dst, " " CONFIG_CMDLINE, COMMAND_LINE_SIZE); if (len < COMMAND_LINE_SIZE - 1) diff --git a/init/Kconfig b/init/Kconfig index af0d84662cc2..fa002e3765ab 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -163,12 +163,6 @@ config CMDLINE_FORCE arguments provided by the bootloader. endchoice -config CMDLINE_EXTEND - bool - default CMDLINE_APPEND - help - To be removed once all architectures are converted to generic CMDLINE - config COMPILE_TEST bool "Compile also drivers which will not load" depends on HAS_IOMEM