Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808328/?format=api
{ "id": 808328, "url": "http://patchwork.ozlabs.org/api/patches/808328/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/1504198860-12951-10-git-send-email-Dave.Martin@arm.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1504198860-12951-10-git-send-email-Dave.Martin@arm.com>", "list_archive_url": null, "date": "2017-08-31T17:00:41", "name": "[v2,09/28] arm64/sve: Signal frame and context structure definition", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2d7ad2d613dbbd0b692f5fc4d88553601ae191d4", "submitter": { "id": 26612, "url": "http://patchwork.ozlabs.org/api/people/26612/?format=api", "name": "Dave Martin", "email": "Dave.Martin@arm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/1504198860-12951-10-git-send-email-Dave.Martin@arm.com/mbox/", "series": [ { "id": 882, "url": "http://patchwork.ozlabs.org/api/series/882/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=882", "date": "2017-08-31T17:00:32", "name": "ARM Scalable Vector Extension (SVE)", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/882/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808328/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808328/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-83968-incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list libc-alpha@sourceware.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83968-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"heDzm0wo\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\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 3xjpbJ1w95z9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 1 Sep 2017 03:02:52 +1000 (AEST)", "(qmail 80394 invoked by alias); 31 Aug 2017 17:01:44 -0000", "(qmail 80314 invoked by uid 89); 31 Aug 2017 17:01:44 -0000" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-type:content-transfer-encoding;\n\tq=dns; s=default; b=YfotYs+jnRsUcHY83AmCHWsxU2XUeo5vlt9nfKHY6fP\n\t5CnUdh+7LMzmWGh4GL3fauks0YfdF2e4ymVDL+WZSQzrlYc2PQUmd++IqJQoyWIt\n\tJhFZR+cq8sRTo0KiK2cyWn3EvOQgjFVukcUAfuEPW8GEJImA/Ezb30jmEMDrp/O0\n\t=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-type:content-transfer-encoding;\n\ts=default; bh=iwg9JY6yzcsWPcBcz7tXb4gpe7I=; b=heDzm0wo8vs/U/QU/\n\tik88N0LqnT7N2DtPJkWuT3x2d4oH6aTzra/FlU9K23Acf4+IFaFmCLxOKBI4PQ9f\n\tuofgzDUDTsfpjxhGRQQfQV2GGLK5u5urlw7X7nBZpAEprVG8wpXjNPbq+EgJPUA2\n\taCuPXu3g+AQZFSmWUXXVE9+dJo=", "Mailing-List": "contact libc-alpha-help@sourceware.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<libc-alpha.sourceware.org>", "List-Unsubscribe": "<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>", "List-Subscribe": "<mailto:libc-alpha-subscribe@sourceware.org>", "List-Archive": "<http://sourceware.org/ml/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>", "Sender": "libc-alpha-owner@sourceware.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=1164", "X-Spam-User": "qpsmtpd, 2 recipients", "X-HELO": "foss.arm.com", "From": "Dave Martin <Dave.Martin@arm.com>", "To": "linux-arm-kernel@lists.infradead.org", "Cc": "Catalin Marinas <catalin.marinas@arm.com>, Will Deacon\n\t<will.deacon@arm.com>, \tArd Biesheuvel <ard.biesheuvel@linaro.org>,\n\t=?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= <alex.bennee@linaro.org>,\n\tSzabolcs Nagy <szabolcs.nagy@arm.com>, Richard Sandiford\n\t<richard.sandiford@arm.com>, \tkvmarm@lists.cs.columbia.edu,\n\tlibc-alpha@sourceware.org, \tlinux-arch@vger.kernel.org,\n\tgdb@sourceware.org, \tAlan Hayward <alan.hayward@arm.com>,\n\tYao Qi <Yao.Qi@arm.com>", "Subject": "[PATCH v2 09/28] arm64/sve: Signal frame and context structure\n\tdefinition", "Date": "Thu, 31 Aug 2017 18:00:41 +0100", "Message-Id": "<1504198860-12951-10-git-send-email-Dave.Martin@arm.com>", "In-Reply-To": "<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>", "References": "<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit" }, "content": "This patch defines the representation that will be used for the SVE\nregister state in the signal frame, and implements support for\nsaving and restoring the SVE registers around signals.\n\nThe same layout will also be used for the in-kernel task state.\n\nDue to the variability of the SVE vector length, it is not possible\nto define a fixed C struct to describe all the registers. Instead,\nMacros are defined in sigcontext.h to facilitate access to the\nparts of the structure.\n\nSigned-off-by: Dave Martin <Dave.Martin@arm.com>\nCc: Alex Bennée <alex.bennee@linaro.org>\n\n---\n\nChanges since v1\n----------------\n\nRequested by Alex Bennée:\n\n* Add SVE_VQ_BYTES #define to make it clear when the code is\nintentionally referring to the size in bytes of a quadword, and migrate\naway from magic 16/0x10 where used with this meaning.\n---\n arch/arm64/include/uapi/asm/sigcontext.h | 117 ++++++++++++++++++++++++++++++-\n 1 file changed, 116 insertions(+), 1 deletion(-)", "diff": "diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h\nindex f0a76b9..c78cf8e 100644\n--- a/arch/arm64/include/uapi/asm/sigcontext.h\n+++ b/arch/arm64/include/uapi/asm/sigcontext.h\n@@ -16,6 +16,8 @@\n #ifndef _UAPI__ASM_SIGCONTEXT_H\n #define _UAPI__ASM_SIGCONTEXT_H\n \n+#ifndef __ASSEMBLY__\n+\n #include <linux/types.h>\n \n /*\n@@ -41,10 +43,11 @@ struct sigcontext {\n *\n *\t0x210\t\tfpsimd_context\n *\t 0x10\t\tesr_context\n+ *\t0x8a0\t\tsve_context (vl <= 64) (optional)\n *\t 0x20\t\textra_context (optional)\n *\t 0x10\t\tterminator (null _aarch64_ctx)\n *\n- *\t0xdb0\t\t(reserved for future allocation)\n+ *\t0x510\t\t(reserved for future allocation)\n *\n * New records that can exceed this space need to be opt-in for userspace, so\n * that an expanded signal frame is not generated unexpectedly. The mechanism\n@@ -116,4 +119,116 @@ struct extra_context {\n \t__u32 __reserved[3];\n };\n \n+#define SVE_MAGIC\t0x53564501\n+\n+struct sve_context {\n+\tstruct _aarch64_ctx head;\n+\t__u16 vl;\n+\t__u16 __reserved[3];\n+};\n+\n+#endif /* !__ASSEMBLY__ */\n+\n+/*\n+ * The SVE architecture leaves space for future expansion of the\n+ * vector length beyond its initial architectural limit of 2048 bits\n+ * (16 quadwords).\n+ */\n+#define SVE_VQ_BYTES\t\t0x10\t/* number of bytes per quadword */\n+\n+#define SVE_VQ_MIN\t\t1\n+#define SVE_VQ_MAX\t\t0x200\n+\n+#define SVE_VL_MIN\t\t(SVE_VQ_MIN * SVE_VQ_BYTES)\n+#define SVE_VL_MAX\t\t(SVE_VQ_MAX * SVE_VQ_BYTES)\n+\n+#define SVE_NUM_ZREGS\t\t32\n+#define SVE_NUM_PREGS\t\t16\n+\n+#define sve_vl_valid(vl) \\\n+\t((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)\n+#define sve_vq_from_vl(vl)\t((vl) / SVE_VQ_BYTES)\n+#define sve_vl_from_vq(vq)\t((vq) * SVE_VQ_BYTES)\n+\n+/*\n+ * If the SVE registers are currently live for the thread at signal delivery,\n+ * sve_context.head.size >=\n+ *\tSVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl))\n+ * and the register data may be accessed using the SVE_SIG_*() macros.\n+ *\n+ * If sve_context.head.size <\n+ *\tSVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)),\n+ * the SVE registers were not live for the thread and no register data\n+ * is included: in this case, the SVE_SIG_*() macros should not be\n+ * used except for this check.\n+ *\n+ * The same convention applies when returning from a signal: a caller\n+ * will need to remove or resize the sve_context block if it wants to\n+ * make the SVE registers live when they were previously non-live or\n+ * vice-versa. This may require the the caller to allocate fresh\n+ * memory and/or move other context blocks in the signal frame.\n+ *\n+ * Changing the vector length during signal return is not permitted:\n+ * sve_context.vl must equal the thread's current vector length when\n+ * doing a sigreturn.\n+ *\n+ *\n+ * Note: for all these macros, the \"vq\" argument denotes the SVE\n+ * vector length in quadwords (i.e., units of 128 bits).\n+ *\n+ * The correct way to obtain vq is to use sve_vq_from_vl(vl). The\n+ * result is valid if and only if sve_vl_valid(vl) is true. This is\n+ * guaranteed for a struct sve_context written by the kernel.\n+ *\n+ *\n+ * Additional macros describe the contents and layout of the payload.\n+ * For each, SVE_SIG_x_OFFSET(args) is the start offset relative to\n+ * the start of struct sve_context, and SVE_SIG_x_SIZE(args) is the\n+ * size in bytes:\n+ *\n+ *\tx\ttype\t\t\t\tdescription\n+ *\t-\t----\t\t\t\t-----------\n+ *\tREGS\t\t\t\t\tthe entire SVE context\n+ *\n+ *\tZREGS\t__uint128_t[SVE_NUM_ZREGS][vq]\tall Z-registers\n+ *\tZREG\t__uint128_t[vq]\t\t\tindividual Z-register Zn\n+ *\n+ *\tPREGS\tuint16_t[SVE_NUM_PREGS][vq]\tall P-registers\n+ *\tPREG\tuint16_t[vq]\t\t\tindividual P-register Pn\n+ *\n+ *\tFFR\tuint16_t[vq]\t\t\tfirst-fault status register\n+ *\n+ * Additional data might be appended in the future.\n+ */\n+\n+#define SVE_SIG_ZREG_SIZE(vq)\t((__u32)(vq) * SVE_VQ_BYTES)\n+#define SVE_SIG_PREG_SIZE(vq)\t((__u32)(vq) * (SVE_VQ_BYTES / 8))\n+#define SVE_SIG_FFR_SIZE(vq)\tSVE_SIG_PREG_SIZE(vq)\n+\n+#define SVE_SIG_REGS_OFFSET\t\t\t\t\t\\\n+\t((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1))\t\\\n+\t\t/ SVE_VQ_BYTES * SVE_VQ_BYTES)\n+\n+#define SVE_SIG_ZREGS_OFFSET\tSVE_SIG_REGS_OFFSET\n+#define SVE_SIG_ZREG_OFFSET(vq, n) \\\n+\t(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))\n+#define SVE_SIG_ZREGS_SIZE(vq) \\\n+\t(SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)\n+\n+#define SVE_SIG_PREGS_OFFSET(vq) \\\n+\t(SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))\n+#define SVE_SIG_PREG_OFFSET(vq, n) \\\n+\t(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))\n+#define SVE_SIG_PREGS_SIZE(vq) \\\n+\t(SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))\n+\n+#define SVE_SIG_FFR_OFFSET(vq) \\\n+\t(SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))\n+\n+#define SVE_SIG_REGS_SIZE(vq) \\\n+\t(SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)\n+\n+#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))\n+\n+\n #endif /* _UAPI__ASM_SIGCONTEXT_H */\n", "prefixes": [ "v2", "09/28" ] }