Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1460181/?format=api
{ "id": 1460181, "url": "http://patchwork.ozlabs.org/api/patches/1460181/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/", "date": "2021-03-30T17:56:56", "name": "[1/8] CMDLINE: add generic builtin command line", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "adc6b71f7e3d43924286b4693143e61c01bc4cf2", "submitter": { "id": 67374, "url": "http://patchwork.ozlabs.org/api/people/67374/?format=api", "name": "Daniel Walker (danielwa)", "email": "danielwa@cisco.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com/mbox/", "series": [ { "id": 236583, "url": "http://patchwork.ozlabs.org/api/series/236583/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=236583", "date": "2021-03-30T17:56:56", "name": "[1/8] CMDLINE: add generic builtin command line", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/236583/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1460181/comments/", "check": "warning", "checks": "http://patchwork.ozlabs.org/api/patches/1460181/checks/", "tags": {}, "related": [ { "id": 1449472, "url": "http://patchwork.ozlabs.org/api/patches/1449472/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210308235319.2988609-2-danielwa@cisco.com/", "msgid": "<20210308235319.2988609-2-danielwa@cisco.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210308235319.2988609-2-danielwa@cisco.com/", "date": "2021-03-08T23:53:09", "name": "[v2,1/7] CMDLINE: add generic builtin command line", "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210308235319.2988609-2-danielwa@cisco.com/mbox/" }, { "id": 1449477, "url": "http://patchwork.ozlabs.org/api/patches/1449477/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210309000247.2989531-2-danielwa@cisco.com/", "msgid": "<20210309000247.2989531-2-danielwa@cisco.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210309000247.2989531-2-danielwa@cisco.com/", "date": "2021-03-09T00:02:37", "name": "[v2,1/7] CMDLINE: add generic builtin command line", "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210309000247.2989531-2-danielwa@cisco.com/mbox/" }, { "id": 1466831, "url": "http://patchwork.ozlabs.org/api/patches/1466831/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210416040924.2882771-2-danielwa@cisco.com/", "msgid": "<20210416040924.2882771-2-danielwa@cisco.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210416040924.2882771-2-danielwa@cisco.com/", "date": "2021-04-16T04:09:12", "name": "[1/8] CMDLINE: add generic builtin command line", "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210416040924.2882771-2-danielwa@cisco.com/mbox/" } ], "headers": { "Return-Path": "\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Authentication-Results": [ "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=hTx7xGIU;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=hTx7xGIU;\n\tdkim-atps=neutral", "lists.ozlabs.org; spf=pass (sender SPF authorized)\n smtp.mailfrom=cisco.com (client-ip=173.37.86.73; helo=rcdn-iport-2.cisco.com;\n envelope-from=danielwa@cisco.com; receiver=<UNKNOWN>)", "lists.ozlabs.org; dkim=pass (1024-bit key;\n unprotected) header.d=cisco.com header.i=@cisco.com header.a=rsa-sha256\n header.s=iport header.b=hTx7xGIU; dkim-atps=neutral" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4F8xxN4WxZz9sRR\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 04:57:44 +1100 (AEDT)", "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4F8xxN3KZtz3c72\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 31 Mar 2021 04:57:44 +1100 (AEDT)", "from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4F8xwn061Dz3bvq\n for <linuxppc-dev@lists.ozlabs.org>; Wed, 31 Mar 2021 04:57:10 +1100 (AEDT)", "from rcdn-core-2.cisco.com ([173.37.93.153])\n by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 30 Mar 2021 17:57:07 +0000", "from zorba.cisco.com ([10.24.8.123])\n by rcdn-core-2.cisco.com (8.15.2/8.15.2) with ESMTP id 12UHv6CE024502;\n Tue, 30 Mar 2021 17:57:06 GMT" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=7816; q=dns/txt; s=iport;\n t=1617127033; x=1618336633;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=PVYj4/JEMLiilwFZR8HYiGm4NMCrkVblgX2Uf1aFQnA=;\n b=hTx7xGIUPi049fDmk+KznjcQi9/OSmSpcLZU+v2kk4/cv0rJvdEOn4/v\n kMo/DxDcwhBvZDBYItQ5DcGVSkFrw+gad/9T6nhtkggWaNZr85s9aFUjQ\n tADa7qwH2Y3gfcPGfzT6/uabR73h8jbahBtTP0iCSKCvb6gYWnKAbRoJV 8=;", "X-IronPort-AV": "E=Sophos;i=\"5.81,291,1610409600\"; d=\"scan'208\";a=\"881996291\"", "From": "Daniel Walker <danielwa@cisco.com>", "To": "Will Deacon <will@kernel.org>,\n Christophe Leroy <christophe.leroy@csgroup.eu>,\n ob Herring <robh@kernel.org>,\n Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>,\n Andrew Morton <akpm@linux-foundation.org>, x86@kernel.org,\n linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org", "Subject": "[PATCH 1/8] CMDLINE: add generic builtin command line", "Date": "Tue, 30 Mar 2021 10:56:56 -0700", "Message-Id": "\n <41021d66db2ab427c14255d2a24bb4517c8b58fd.1617126961.git.danielwa@cisco.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Auto-Response-Suppress": "DR, OOF, AutoReply", "X-Outbound-SMTP-Client": "10.24.8.123, [10.24.8.123]", "X-Outbound-Node": "rcdn-core-2.cisco.com", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n <mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Ruslan Bilovol <rbilovol@cisco.com>, linux-kernel@vger.kernel.org,\n xe-linux-external@cisco.com", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n <linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "This code allows architectures to use a generic builtin command line.\nThe state of the builtin command line options across architecture is\ndiverse. MIPS and X86 once has similar systems, then mips added some\noptions to allow extending the command line. Powerpc did something\nsimiar in adding the ability to extend. Even with mips and powerpc\nenhancement the needs of Cisco are not met on these platforms.\n\nThe code in this commit unifies the code into a generic\nheader file under the CONFIG_GENERIC_CMDLINE option. When this\noption is enabled the architecture can call the cmdline_add_builtin()\nto add the builtin command line.\n\nThis unified implementation offers the same functionality needed by\nCisco on all platform which use it.\n\nCc: xe-linux-external@cisco.com\nSigned-off-by: Ruslan Bilovol <rbilovol@cisco.com>\nSigned-off-by: Daniel Walker <danielwa@cisco.com>\n---\n include/linux/cmdline.h | 98 +++++++++++++++++++++++++++++++++++++++++\n init/Kconfig | 72 ++++++++++++++++++++++++++++++\n 2 files changed, 170 insertions(+)\n create mode 100644 include/linux/cmdline.h", "diff": "diff --git a/include/linux/cmdline.h b/include/linux/cmdline.h\nnew file mode 100644\nindex 000000000000..439c4585feba\n--- /dev/null\n+++ b/include/linux/cmdline.h\n@@ -0,0 +1,98 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+#ifndef _LINUX_CMDLINE_H\n+#define _LINUX_CMDLINE_H\n+\n+/*\n+ *\n+ * Copyright (C) 2006,2021. Cisco Systems, Inc.\n+ *\n+ * Generic Append/Prepend cmdline support.\n+ */\n+\n+#if defined(CONFIG_GENERIC_CMDLINE) && defined(CONFIG_CMDLINE_BOOL)\n+\n+#ifndef CONFIG_CMDLINE_OVERRIDE\n+#define GENERIC_CMDLINE_NEED_STRLCAT\n+#define CMDLINE_PREPEND CONFIG_CMDLINE_PREPEND\n+#define CMDLINE_APPEND CONFIG_CMDLINE_APPEND\n+\n+/*\n+ * This function will append or prepend a builtin command line to the command\n+ * line provided by the bootloader. Kconfig options can be used to alter\n+ * the behavior of this builtin command line.\n+ * @dest: The destination of the final appended/prepended string\n+ * @src: The starting string or NULL if there isn't one.\n+ * @tmp: temporary space used for prepending\n+ * @length: the maximum length of the strings above.\n+ * @cmdline_strlcpy: point to a compatible strlcpy\n+ * @cmdline_strlcat: point to a compatible strlcat\n+ */\n+static inline void\n+__cmdline_add_builtin(char *dest, const char *src, char *tmp, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size),\n+\t\tsize_t (*cmdline_strlcat)(char *dest, const char *src, size_t count))\n+{\n+\tif (src != dest && src != NULL) {\n+\t\tcmdline_strlcpy(dest, \" \", length);\n+\t\tcmdline_strlcat(dest, src, length);\n+\t}\n+\n+\tif (sizeof(CONFIG_CMDLINE_APPEND) > 1)\n+\t\tcmdline_strlcat(dest, \" \" CONFIG_CMDLINE_APPEND, length);\n+\n+\tif (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {\n+\t\tcmdline_strlcpy(tmp, CONFIG_CMDLINE_PREPEND \" \", length);\n+\t\tcmdline_strlcat(tmp, dest, length);\n+\t\tcmdline_strlcpy(dest, tmp, length);\n+\t}\n+}\n+\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\t\t\\\n+{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n+\tif (sizeof(CONFIG_CMDLINE_PREPEND) > 1) {\t\t\t\t\t\t\t\t\\\n+\t\tstatic label char cmdline_tmp_space[length];\t\t\t\t\t\t\t\\\n+\t\t__cmdline_add_builtin(dest, src, cmdline_tmp_space, length, cmdline_strlcpy, cmdline_strlcat);\t\\\n+\t} else if (sizeof(CONFIG_CMDLINE_APPEND) > 1) {\t\t\t\t\t\t\t\t\\\n+\t\t__cmdline_add_builtin(dest, src, NULL, length, cmdline_strlcpy, cmdline_strlcat);\t\t\\\n+\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\\\n+}\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\tcmdline_add_builtin_custom(dest, src, length, __initdata, strlcpy, strlcat)\n+\n+#else /* CONFIG_CMDLINE_OVERRIDE */\n+\n+#define CMDLINE_PREPEND CONFIG_CMDLINE_PREPEND\n+#define CMDLINE_APPEND CONFIG_CMDLINE_APPEND\n+\n+static inline void\n+__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))\n+{\n+\tcmdline_strlcpy(dest, CONFIG_CMDLINE_PREPEND \" \" CONFIG_CMDLINE_APPEND, length);\n+}\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, strlcpy)\n+#endif /* !CONFIG_CMDLINE_OVERRIDE */\n+\n+#else /* !CONFIG_GENERIC_CMDLINE || !CONFIG_CMDLINE_BOOL */\n+\n+#define CMDLINE_PREPEND \"\"\n+#define CMDLINE_APPEND \"\"\n+\n+static inline void\n+__cmdline_add_builtin_custom(char *dest, const char *src, unsigned long length,\n+\t\tsize_t (*cmdline_strlcpy)(char *dest, const char *src, size_t size))\n+{\n+\tif (src != NULL)\n+\t\tcmdline_strlcpy(dest, src, length);\n+}\n+#define cmdline_add_builtin_custom(dest, src, length, label, cmdline_strlcpy, cmdline_strlcat)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, cmdline_strlcpy)\n+#define cmdline_add_builtin(dest, src, length)\t\\\n+\t__cmdline_add_builtin_custom(dest, src, length, strlcpy)\t\\\n+\n+#endif /* CONFIG_GENERIC_CMDLINE */\n+\n+#endif /* _LINUX_CMDLINE_H */\ndiff --git a/init/Kconfig b/init/Kconfig\nindex 5f5c776ef192..84f06f62550a 100644\n--- a/init/Kconfig\n+++ b/init/Kconfig\n@@ -2034,6 +2034,78 @@ config PROFILING\n config TRACEPOINTS\n \tbool\n \n+config GENERIC_CMDLINE\n+\tbool\n+\n+config GENERIC_CMDLINE_OF\n+\tbool\n+\n+\n+if GENERIC_CMDLINE\n+\n+config CMDLINE_BOOL\n+\tbool \"Built-in kernel command line\"\n+\thelp\n+\t Allow for specifying boot arguments to the kernel at\n+\t build time. On some systems (e.g. embedded ones), it is\n+\t necessary or convenient to provide some or all of the\n+\t kernel boot arguments with the kernel itself (that is,\n+\t to not rely on the boot loader to provide them.)\n+\n+\t To compile command line arguments into the kernel,\n+\t set this option to 'Y', then fill in the\n+\t the boot arguments in CONFIG_CMDLINE.\n+\n+\t Systems with fully functional boot loaders (i.e. non-embedded)\n+\t should leave this option set to 'N'.\n+\n+config CMDLINE_APPEND\n+\tstring \"Built-in kernel command string append\"\n+\tdepends on CMDLINE_BOOL\n+\tdefault \"\"\n+\thelp\n+\t Enter arguments here that should be compiled into the kernel\n+\t image and used at boot time. If the boot loader provides a\n+\t command line at boot time, this string is appended to it to\n+\t form the full kernel command line, when the system boots.\n+\n+\t However, you can use the CONFIG_CMDLINE_OVERRIDE option to\n+\t change this behavior.\n+\n+\t In most cases, the command line (whether built-in or provided\n+\t by the boot loader) should specify the device for the root\n+\t file system.\n+\n+config CMDLINE_PREPEND\n+\tstring \"Built-in kernel command string prepend\"\n+\tdepends on CMDLINE_BOOL\n+\tdefault \"\"\n+\thelp\n+\t Enter arguments here that should be compiled into the kernel\n+\t image and used at boot time. If the boot loader provides a\n+\t command line at boot time, this string is prepended to it to\n+\t form the full kernel command line, when the system boots.\n+\n+\t However, you can use the CONFIG_CMDLINE_OVERRIDE option to\n+\t change this behavior.\n+\n+\t In most cases, the command line (whether built-in or provided\n+\t by the boot loader) should specify the device for the root\n+\t file system.\n+\n+config CMDLINE_OVERRIDE\n+\tbool \"Built-in command line overrides boot loader arguments\"\n+\tdepends on CMDLINE_BOOL\n+\thelp\n+\t Set this option to 'Y' to have the kernel ignore the boot loader\n+\t command line, and use ONLY the built-in command line. In this case\n+\t append and prepend strings are concatenated to form the full\n+\t command line.\n+\n+\t This is used to work around broken boot loaders. This should\n+\t be set to 'N' under normal conditions.\n+endif\n+\n endmenu\t\t# General setup\n \n source \"arch/Kconfig\"\n", "prefixes": [ "1/8" ] }