get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1466840/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1466840,
    "url": "http://patchwork.ozlabs.org/api/patches/1466840/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210416040924.2882771-6-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": "<20210416040924.2882771-6-danielwa@cisco.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20210416040924.2882771-6-danielwa@cisco.com/",
    "date": "2021-04-16T04:09:16",
    "name": "[5/8] drivers: firmware: efi: libstub: enable generic commandline",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "c43d8a83b6d2e86f84bc1ddd87cd31d3780ec49f",
    "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/20210416040924.2882771-6-danielwa@cisco.com/mbox/",
    "series": [
        {
            "id": 239425,
            "url": "http://patchwork.ozlabs.org/api/series/239425/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=239425",
            "date": "2021-04-16T04:09:11",
            "name": "generic command line v4",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/239425/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1466840/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1466840/checks/",
    "tags": {},
    "related": [
        {
            "id": 1460187,
            "url": "http://patchwork.ozlabs.org/api/patches/1460187/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/e5d98d566c38d6f8516b8d9d1fd603ec1f131037.1617126961.git.danielwa@cisco.com/",
            "msgid": "<e5d98d566c38d6f8516b8d9d1fd603ec1f131037.1617126961.git.danielwa@cisco.com>",
            "list_archive_url": "https://lore.kernel.org/linuxppc-dev/e5d98d566c38d6f8516b8d9d1fd603ec1f131037.1617126961.git.danielwa@cisco.com/",
            "date": "2021-03-30T17:57:01",
            "name": "[6/8] drivers: firmware: efi: libstub: enable generic commandline",
            "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/e5d98d566c38d6f8516b8d9d1fd603ec1f131037.1617126961.git.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=112.213.38.117; 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=lliwMLuo;\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=lliwMLuo;\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=lliwMLuo; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\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 4FM2qc4fTZz9sVv\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 16 Apr 2021 14:12:44 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4FM2qc3k74z3d7v\n\tfor <patchwork-incoming@ozlabs.org>; Fri, 16 Apr 2021 14:12:44 +1000 (AEST)",
            "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 4FM2m53v0xz3bry\n for <linuxppc-dev@lists.ozlabs.org>; Fri, 16 Apr 2021 14:09:40 +1000 (AEST)",
            "from alln-core-6.cisco.com ([173.36.13.139])\n by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA;\n 16 Apr 2021 04:09:37 +0000",
            "from zorba.cisco.com ([10.24.7.67])\n by alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTP id 13G49OHk016753;\n Fri, 16 Apr 2021 04:09:36 GMT"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=cisco.com; i=@cisco.com; l=6345; q=dns/txt; s=iport;\n t=1618546181; x=1619755781;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=T0dqf2G5BwtvYRMNblg5cdJ5G97sKXyBbLO+A5ot9gQ=;\n b=lliwMLuoZPIr0hHtE1IBE1f+SJm8uNMOP7tX/LwbOaNDtQfFn/uQPjom\n AUczSHx9Us8BB5MRvd9FxcgdqWyYZ4FlK1kJeICLDhWVS3/m3eJphgKJ4\n lEHCedYwqHGR9kxzoNS+n18XnpWlAE/fpWEaS1xzAK6f7TpwUIkH7jYDV Q=;",
        "IronPort-HdrOrdr": "\n A9a23:HWICPaoLSHeSlS+2WqACRv0aV5t2L9V00zAX/kB9WHVpW+aT/vrDoN0w0xjohDENHEw6kdebN6WaBV/a/5h54Y4eVI3SODXOlWO0IOhZg7fK7CbnH0TFnNJ19aAlSKRmDc21MF4St7eY3CCdM/INhOaK67qpg+C29QYJcShPZ7t75wl0TiaXe3cWeCB8CZA0FIWR66N8zlLKRV0tYsu2HXUDVeTYzue79q7OWwIMBBIs9WC14g+A1biSKXWl9yZbey9Tx/MY/XLdlQvi6uGYr+ij0RPHzQbonvNrseqk7tNCAcCW4/J0FhzcziC1eY9mR7qO+Bcyre3H0idSrPD85zE9Is9093TdOluQnCKo8Qzh3DEygkWSr2OlvQ==",
        "X-IronPort-Anti-Spam-Filtered": "true",
        "X-IronPort-Anti-Spam-Result": "\n A0AYAACIDXlg/4sNJK1aGwEBAQEBAQEBBQEBARIBAQEDAwEBAYF+BgEBAQsBAYIpgU0BOTGMZ4lOmm6BfAsBAQEPNAQBAYRQAoFzAiU0CQ4CAwEBDAEBBQEBAQIBBgRxE4VdQxYBhWsGJwsBRhBRVwYBEoJxgwisB4F4M4EBiDOBRBSBJQGHW4EQdAaDbyccgUlChHOKOQSCRz1SSwKCUpA7FAaNV4EgmXmBFIMWgSaYZoJrDyOkfJUYnldghCuBVDqBWTMaCBsVgyRQGQ6OKxaNawFbIQMvOAIGCgEBAwmJToNAAQE",
        "X-IronPort-AV": "E=Sophos;i=\"5.82,226,1613433600\"; d=\"scan'208\";a=\"888361936\"",
        "From": "Daniel Walker <danielwa@cisco.com>",
        "To": "Will Deacon <will@kernel.org>,\n Christophe Leroy <christophe.leroy@csgroup.eu>,\n Rob 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 5/8] drivers: firmware: efi: libstub: enable generic\n commandline",
        "Date": "Thu, 15 Apr 2021 21:09:16 -0700",
        "Message-Id": "<20210416040924.2882771-6-danielwa@cisco.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210416040924.2882771-1-danielwa@cisco.com>",
        "References": "<20210416040924.2882771-1-danielwa@cisco.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Auto-Response-Suppress": "DR, OOF, AutoReply",
        "X-Outbound-SMTP-Client": "10.24.7.67, [10.24.7.67]",
        "X-Outbound-Node": "alln-core-6.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": "linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,\n Ard Biesheuvel <ardb@kernel.org>, 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 adds code to handle the generic command line changes.\nThe efi code appears that it doesn't benefit as much from this design\nas it could.\n\nFor example, if you had a prepend command line with \"nokaslr\" then\nyou might be helpful to re-enable it in the boot loader or dts,\nbut there appears to be no way to re-enable kaslr or some of the\nother options.\n\nThe efi command line handling is incorrect. x86 and arm have an append\nsystem however the efi code prepends the command line.\n\nFor example, you could have a non-upgradable bios which sends\n\nefi=disable_early_pci_dma\n\nThis hypothetically could have been set because early pci dma caused\nissues on early versions of the product.\n\nThen later the early pci dma was made to work and the company desired\nto start using it. To override the bios you could set the CONFIG_CMDLINE\nto,\n\nefi=no_disable_early_pci_dma\n\nthen parsing would normally start with the bios command line, then move\nto the CONFIG_CMDLINE and you would end up with early pci dma turned on.\n\nhowever, current efi code keeps early pci dma off because the bios\narguments always override the built in.\n\nPer my reading this is different from the main body of x86, arm, and\narm64.\n\nThe generic command line provides both append and prepend, so it\nalleviates this issue if it's used. However not all architectures use\nit.\n\nIt would be desirable to allow the efi stub to have it's builtin command\nline to be modified after compile, but I don't see a feasible way to do\nthat currently.\n\nCc: xe-linux-external@cisco.com\nSigned-off-by: Daniel Walker <danielwa@cisco.com>\n---\n .../firmware/efi/libstub/efi-stub-helper.c    | 29 +++++++++++++++++++\n drivers/firmware/efi/libstub/efi-stub.c       |  9 ++++++\n drivers/firmware/efi/libstub/efistub.h        |  1 +\n drivers/firmware/efi/libstub/x86-stub.c       | 13 +++++++--\n 4 files changed, 50 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c\nindex aa8da0a49829..16318f55f187 100644\n--- a/drivers/firmware/efi/libstub/efi-stub-helper.c\n+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c\n@@ -13,6 +13,7 @@\n #include <linux/efi.h>\n #include <linux/kernel.h>\n #include <linux/printk.h> /* For CONSOLE_LOGLEVEL_* */\n+#include <linux/cmdline.h>\n #include <asm/efi.h>\n #include <asm/setup.h>\n \n@@ -172,6 +173,34 @@ int efi_printk(const char *fmt, ...)\n \treturn printed;\n }\n \n+/**\n+ * efi_handle_cmdline() - handle adding in building parts of the command line\n+ * @cmdline:\tkernel command line\n+ *\n+ * Add in the generic parts of the commandline and start the parsing of the\n+ * command line.\n+ *\n+ * Return:\tstatus code\n+ */\n+efi_status_t efi_handle_cmdline(char const *cmdline)\n+{\n+\tefi_status_t status = EFI_SUCCESS;\n+\n+\tif (sizeof(CMDLINE_STATIC_PREPEND) > 1)\n+\t\tstatus |= efi_parse_options(CMDLINE_STATIC_PREPEND);\n+\n+\tif (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE))\n+\t\tstatus |= efi_parse_options(cmdline);\n+\n+\tif (sizeof(CMDLINE_STATIC_APPEND) > 1)\n+\t\tstatus |= efi_parse_options(CMDLINE_STATIC_APPEND);\n+\n+\tif (status != EFI_SUCCESS)\n+\t\tefi_err(\"Failed to parse options\\n\");\n+\n+\treturn status;\n+}\n+\n /**\n  * efi_parse_options() - Parse EFI command line options\n  * @cmdline:\tkernel command line\ndiff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c\nindex 26e69788f27a..baa69b24cfdd 100644\n--- a/drivers/firmware/efi/libstub/efi-stub.c\n+++ b/drivers/firmware/efi/libstub/efi-stub.c\n@@ -172,6 +172,14 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,\n \t\tgoto fail;\n \t}\n \n+#ifdef CONFIG_GENERIC_CMDLINE\n+\tstatus = efi_handle_cmdline(cmdline_ptr);\n+\tif (status != EFI_SUCCESS) {\n+\t\tgoto fail_free_cmdline;\n+\t}\n+#endif\n+\n+#ifdef CONFIG_CMDLINE\n \tif (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||\n \t    IS_ENABLED(CONFIG_CMDLINE_FORCE) ||\n \t    cmdline_size == 0) {\n@@ -189,6 +197,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,\n \t\t\tgoto fail_free_cmdline;\n \t\t}\n \t}\n+#endif\n \n \tefi_info(\"Booting Linux Kernel...\\n\");\n \ndiff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h\nindex cde0a2ef507d..07c7f9fdfffc 100644\n--- a/drivers/firmware/efi/libstub/efistub.h\n+++ b/drivers/firmware/efi/libstub/efistub.h\n@@ -800,6 +800,7 @@ efi_status_t efi_relocate_kernel(unsigned long *image_addr,\n \t\t\t\t unsigned long alignment,\n \t\t\t\t unsigned long min_addr);\n \n+efi_status_t efi_handle_cmdline(char const *cmdline);\n efi_status_t efi_parse_options(char const *cmdline);\n \n void efi_parse_option_graphics(char *option);\ndiff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c\nindex f14c4ff5839f..30ad8fb7122d 100644\n--- a/drivers/firmware/efi/libstub/x86-stub.c\n+++ b/drivers/firmware/efi/libstub/x86-stub.c\n@@ -673,6 +673,8 @@ unsigned long efi_main(efi_handle_t handle,\n \tunsigned long bzimage_addr = (unsigned long)startup_32;\n \tunsigned long buffer_start, buffer_end;\n \tstruct setup_header *hdr = &boot_params->hdr;\n+\tunsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr |\n+\t\t\t\t       ((u64)boot_params->ext_cmd_line_ptr << 32));\n \tefi_status_t status;\n \n \tefi_system_table = sys_table_arg;\n@@ -735,6 +737,14 @@ unsigned long efi_main(efi_handle_t handle,\n \t\timage_offset = 0;\n \t}\n \n+#ifdef CONFIG_GENERIC_CMDLINE\n+\tstatus = efi_handle_cmdline((char *)cmdline_paddr);\n+\tif (status != EFI_SUCCESS) {\n+\t\tefi_err(\"Failed to parse options\\n\");\n+\t\tgoto fail;\n+\t}\n+#else /* CONFIG_GENERIC_CMDLINE */\n+\n #ifdef CONFIG_CMDLINE_BOOL\n \tstatus = efi_parse_options(CONFIG_CMDLINE);\n \tif (status != EFI_SUCCESS) {\n@@ -743,8 +753,6 @@ unsigned long efi_main(efi_handle_t handle,\n \t}\n #endif\n \tif (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {\n-\t\tunsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr |\n-\t\t\t\t\t       ((u64)boot_params->ext_cmd_line_ptr << 32));\n \t\tstatus = efi_parse_options((char *)cmdline_paddr);\n \t\tif (status != EFI_SUCCESS) {\n \t\t\tefi_err(\"Failed to parse options\\n\");\n@@ -752,6 +760,7 @@ unsigned long efi_main(efi_handle_t handle,\n \t\t}\n \t}\n \n+#endif\n \t/*\n \t * At this point, an initrd may already have been loaded by the\n \t * bootloader and passed via bootparams. We permit an initrd loaded\n",
    "prefixes": [
        "5/8"
    ]
}