get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 831234,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/831234/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-imx/patch/1509101470-7881-22-git-send-email-Dave.Martin@arm.com/",
    "project": {
        "id": 19,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/19/?format=api",
        "name": "Linux IMX development",
        "link_name": "linux-imx",
        "list_id": "linux-imx-kernel.lists.patchwork.ozlabs.org",
        "list_email": "linux-imx-kernel@lists.patchwork.ozlabs.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1509101470-7881-22-git-send-email-Dave.Martin@arm.com>",
    "list_archive_url": null,
    "date": "2017-10-27T10:51:03",
    "name": "[v4,21/28] arm64/sve: Add sysctl to set the default vector length for new processes",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e8875bb4ea2644807c3e083ad8e3e8cd2a08290e",
    "submitter": {
        "id": 26612,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/26612/?format=api",
        "name": "Dave Martin",
        "email": "Dave.Martin@arm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-imx/patch/1509101470-7881-22-git-send-email-Dave.Martin@arm.com/mbox/",
    "series": [
        {
            "id": 10556,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/10556/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-imx/list/?series=10556",
            "date": "2017-10-27T10:50:43",
            "name": "ARM Scalable Vector Extension (SVE)",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/10556/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/831234/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/831234/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming-imx@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming-imx@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"mqAWz4/L\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yNglv4w27z9rxj\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tFri, 27 Oct 2017 21:56:11 +1100 (AEDT)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1e82J4-00081V-Bp; Fri, 27 Oct 2017 10:56:06 +0000",
            "from foss.arm.com ([217.140.101.70])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1e82FJ-0003vI-MH for linux-arm-kernel@lists.infradead.org;\n\tFri, 27 Oct 2017 10:52:31 +0000",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A07FC1A09;\n\tFri, 27 Oct 2017 03:52:00 -0700 (PDT)",
            "from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com\n\t[10.72.51.249])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id\n\tE5F513F24A; Fri, 27 Oct 2017 03:51:58 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Qyip5y80WRT2Ih5LeW2S3e4qKS06u2UMkVC9TmESZmw=;\n\tb=mqAWz4/L73g/3x\n\taN81P1VZlVcNbJn6CO3VY2h2ec2MehVf1upFtov1rMrnVRN2uYyfq90a0Kl3R+9c44zlV42f4Waf8\n\t0AfwtNY/5i9/npE10K1H6Vpvhkv5UkZ6PBW4U63QOwffB9s75V85xStGLOVbApHjJ+NjgUYvhm3R1\n\ttrCJ0bNqqeRqsSn6B3y1ITFvH/X8DlwLHbAzBLkWeofBqTach7kNOgYNtNr66vFkKs+YgFgrVTB6N\n\t9/xkwkoL1/DKsBJMnZW+2F/ClXij3qCfyjKqO6/HNHNNjkmSuU043vHT+vRvL0nF+wcSPwy9E4j97\n\tBYoU2R5Y7v/VrlrJzosA==;",
        "From": "Dave Martin <Dave.Martin@arm.com>",
        "To": "linux-arm-kernel@lists.infradead.org",
        "Subject": "[PATCH v4 21/28] arm64/sve: Add sysctl to set the default vector\n\tlength for new processes",
        "Date": "Fri, 27 Oct 2017 11:51:03 +0100",
        "Message-Id": "<1509101470-7881-22-git-send-email-Dave.Martin@arm.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1509101470-7881-1-git-send-email-Dave.Martin@arm.com>",
        "References": "<1509101470-7881-1-git-send-email-Dave.Martin@arm.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20171027_035214_136415_51BCA178 ",
        "X-CRM114-Status": "GOOD (  17.60  )",
        "X-Spam-Score": "-6.9 (------)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [217.140.101.70 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]",
        "X-BeenThere": "linux-arm-kernel@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-arm-kernel/>",
        "List-Post": "<mailto:linux-arm-kernel@lists.infradead.org>",
        "List-Help": "<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>",
        "Cc": "linux-arch@vger.kernel.org, Okamoto Takayuki <tokamoto@jp.fujitsu.com>,\n\tlibc-alpha@sourceware.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>, \n\tSzabolcs Nagy <szabolcs.nagy@arm.com>, \n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will.deacon@arm.com>, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>,  kvmarm@lists.cs.columbia.edu",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Sender": "\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>",
        "Errors-To": "linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org",
        "List-Id": "linux-imx-kernel.lists.patchwork.ozlabs.org"
    },
    "content": "Because of the effect of SVE on the size of the signal frame, the\ndefault vector length used for new processes involves a tradeoff\nbetween performance of SVE-enabled software on the one hand, and\nreliability of non-SVE-aware software on the other hand.\n\nFor this reason, the best choice depends on the repertoire of\nuserspace software in use and is thus best left up to distro\nmaintainers, sysadmins and developers.\n\nIf CONFIG_SYSCTL and CONFIG_PROC_SYSCTL are enabled, this patch\nexposes the default vector length in\n/proc/sys/abi/sve_default_vector_length, where boot scripts or the\nadventurous can poke it.\n\nIn common with other arm64 ABI sysctls, this control is currently\nglobal: setting it requires CAP_SYS_ADMIN in the root user\nnamespace, but the value set is effective for subsequent execs in\nall namespaces.  The control only affects _new_ processes, however:\nchanging it does not affect the vector length of any existing\nprocess.\n\nThe intended usage model is that if userspace is known to be fully\nSVE-tolerant (or a developer is curious to find out) then this\nparameter can be cranked up during system startup.\n\nSigned-off-by: Dave Martin <Dave.Martin@arm.com>\nReviewed-by: Alex Bennée <alex.bennee@linaro.org>\nReviewed-by: Catalin Marinas <catalin.marinas@arm.com>\n---\n arch/arm64/kernel/fpsimd.c | 62 +++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 61 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c\nindex 7465622..f9d3287 100644\n--- a/arch/arm64/kernel/fpsimd.c\n+++ b/arch/arm64/kernel/fpsimd.c\n@@ -35,6 +35,7 @@\n #include <linux/sched/signal.h>\n #include <linux/signal.h>\n #include <linux/slab.h>\n+#include <linux/sysctl.h>\n \n #include <asm/fpsimd.h>\n #include <asm/cputype.h>\n@@ -333,6 +334,65 @@ static unsigned int find_supported_vector_length(unsigned int vl)\n \treturn sve_vl_from_vq(bit_to_vq(bit));\n }\n \n+#ifdef CONFIG_SYSCTL\n+\n+static int sve_proc_do_default_vl(struct ctl_table *table, int write,\n+\t\t\t\t  void __user *buffer, size_t *lenp,\n+\t\t\t\t  loff_t *ppos)\n+{\n+\tint ret;\n+\tint vl = sve_default_vl;\n+\tstruct ctl_table tmp_table = {\n+\t\t.data = &vl,\n+\t\t.maxlen = sizeof(vl),\n+\t};\n+\n+\tret = proc_dointvec(&tmp_table, write, buffer, lenp, ppos);\n+\tif (ret || !write)\n+\t\treturn ret;\n+\n+\t/* Writing -1 has the special meaning \"set to max\": */\n+\tif (vl == -1) {\n+\t\t/* Fail safe if sve_max_vl wasn't initialised */\n+\t\tif (WARN_ON(!sve_vl_valid(sve_max_vl)))\n+\t\t\tvl = SVE_VL_MIN;\n+\t\telse\n+\t\t\tvl = sve_max_vl;\n+\n+\t\tgoto chosen;\n+\t}\n+\n+\tif (!sve_vl_valid(vl))\n+\t\treturn -EINVAL;\n+\n+\tvl = find_supported_vector_length(vl);\n+chosen:\n+\tsve_default_vl = vl;\n+\treturn 0;\n+}\n+\n+static struct ctl_table sve_default_vl_table[] = {\n+\t{\n+\t\t.procname\t= \"sve_default_vector_length\",\n+\t\t.mode\t\t= 0644,\n+\t\t.proc_handler\t= sve_proc_do_default_vl,\n+\t},\n+\t{ }\n+};\n+\n+static int __init sve_sysctl_init(void)\n+{\n+\tif (system_supports_sve())\n+\t\tif (!register_sysctl(\"abi\", sve_default_vl_table))\n+\t\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n+#else /* ! CONFIG_SYSCTL */\n+static int __init sve_sysctl_init(void) { return 0; }\n+#endif /* ! CONFIG_SYSCTL */\n+\n #define ZREG(sve_state, vq, n) ((char *)(sve_state) +\t\t\\\n \t(SVE_SIG_ZREG_OFFSET(vq, n) - SVE_SIG_REGS_OFFSET))\n \n@@ -1207,6 +1267,6 @@ static int __init fpsimd_init(void)\n \tif (!(elf_hwcap & HWCAP_ASIMD))\n \t\tpr_notice(\"Advanced SIMD is not implemented\\n\");\n \n-\treturn 0;\n+\treturn sve_sysctl_init();\n }\n core_initcall(fpsimd_init);\n",
    "prefixes": [
        "v4",
        "21/28"
    ]
}