[{"id":1768469,"web_url":"http://patchwork.ozlabs.org/comment/1768469/","msgid":"<87inglaaqb.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-14T09:30:20","subject":"Re: [PATCH v2 13/28] arm64/sve: Signal handling support","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Dave Martin <Dave.Martin@arm.com> writes:\n\n> This patch implements support for saving and restoring the SVE\n> registers around signals.\n>\n> A fixed-size header struct sve_context is always included in the\n> signal frame encoding the thread's vector length at the time of\n> signal delivery, optionally followed by a variable-layout structure\n> encoding the SVE registers.\n>\n> Because of the need to preserve backwards compatibility, the FPSIMD\n> view of the SVE registers is always dumped as a struct\n> fpsimd_context in the usual way, in addition to any sve_context.\n>\n> The SVE vector registers are dumped in full, including bits 127:0\n> of each register which alias the corresponding FPSIMD vector\n> registers in the hardware.  To avoid any ambiguity about which\n> alias to restore during sigreturn, the kernel always restores bits\n> 127:0 of each SVE vector register from the fpsimd_context in the\n> signal frame (which must be present): userspace needs to take this\n> into account if it wants to modify the SVE vector register contents\n> on return from a signal.\n>\n> FPSR and FPCR, which are used by both FPSIMD and SVE, are not\n> included in sve_context because they are always present in\n> fpsimd_context anyway.\n>\n> For signal delivery, a new helper\n> fpsimd_signal_preserve_current_state() is added to update _both_\n> the FPSIMD and SVE views in the task struct, to make it easier to\n> populate this information into the signal frame.  Because of the\n> redundancy between the two views of the state, only one is updated\n> otherwise.  In order to avoid racing with a pending discard of the\n> SVE state, this flush is hoisted before the sigframe layout phase,\n> so that the layout and population phases see a consistent view of\n> the thread.\n>\n> Signed-off-by: Dave Martin <Dave.Martin@arm.com>\n> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>\n> Cc: Alex Bennée <alex.bennee@linaro.org>\n>\n\nReviewed-by: Alex Bennée <alex.bennee@linaro.org>\n\n--\nAlex Bennée","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 header.b=\"Z8HjZGhs\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"bGxFZzeS\"; 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 3xtD5N27Pqz9s06\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 19:39:36 +1000 (AEST)","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 1dsQcP-0001HQ-F7; Thu, 14 Sep 2017 09:39:33 +0000","from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dsQTt-0004YO-GP for linux-arm-kernel@lists.infradead.org;\n\tThu, 14 Sep 2017 09:30:47 +0000","by mail-wm0-x22c.google.com with SMTP id i189so8846844wmf.1\n\tfor <linux-arm-kernel@lists.infradead.org>;\n\tThu, 14 Sep 2017 02:30:24 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\th29sm12002590wrf.76.2017.09.14.02.30.21\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 14 Sep 2017 02:30:21 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id DDE343E0132;\n\tThu, 14 Sep 2017 10:30:20 +0100 (BST)"],"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:Message-ID:Date:\n\tIn-reply-to:Subject:To:From:References:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=/w0ZyPSqapowFqmkAVPNmYqZN3rAjLT+zu9Qzzp6Skg=;\n\tb=Z8HjZGhsDA8NjljE/DwvMeiDi6\n\tNq5B6nh8UgdBiP2+HHRRNUFxGGmf6HJt5J1+cAP3eC/AeLrGD89NGVXKRpHULsy/8FoArSZL2S2x/\n\tCHac1j5sVg5qx55SeqM0p2uKCG5Kk0vLz5NmUCuY3OtYrMZiOJFxNg5dHPQnPTLspBp92/rtuwiK4\n\tcUAQWFAx0mszbFfhyAhACofcR9KCZDHknAkRouzaQEjmIqerC0GbJhpTsQ1soGtcIP/hbJGBmPuCz\n\tSqd+9mzLnHT/cwkIbwa4f+0OkYt/6sZqjBvqLkvj/pjVetNUzA/PqUALjfLh2Gm643wWdkKK01SkF\n\tydr0pbzg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=CIOm1vs9odrN7pxEZrhO7lX5kYBq+v9uLWRsWyoNvig=;\n\tb=bGxFZzeSuCqa2Ia9g3R3Sw1+ZcmPdx3g6BTH56QOnd9AHOH4PmBAZcirm+1EBm5t+V\n\t/jA8svM1huzu452JOxd9dpNL2ee0MMMTEtm2JsIe1jYFMxKdHBCB8bgLGqUjOm4Zihmd\n\tQOlabSfpH70bHBJXRVa16U/TDC9y11IS6Tb+w="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=CIOm1vs9odrN7pxEZrhO7lX5kYBq+v9uLWRsWyoNvig=;\n\tb=RMwMSw1+Uqw5YMsVL+eQCX49HTyWm6yxGxLxnuZmz48YgSTjHbOxtZHK1fakkOnD91\n\t9aN+pXQC3O9s+QqmOyu13b9Ew5MVGeLUrghRgbNQ8vUV9xSq+cVz+Pv7iHUqOAmrwHLz\n\tG/+udiEDhwj+bM0auU5sybQxydkik5vn0bfwFqSO70lZaUQfUoRuko0ut7cR/QQK1vKw\n\t0P+5mE1q8I0funpSJAuatFx0XJ5y7fOhQLZ4PJQXbFRwaatmXydGg5WT1lziyoLq8wU0\n\tLks+TgCJSLgtQHxxplYAN0B4vYlGzubWKDG48wdCqXJYtIhst6DRHZTDOALv8y8XeGZi\n\tVCCA==","X-Gm-Message-State":"AHPjjUhGwLAFSNFf+rwgdke3091IPbjuYCRXuGmVPl+87NT4gO2xhbUh\n\tYVGHIS9FUuvEqHAC","X-Google-Smtp-Source":"AOwi7QD2vOrYczKllUWiL6J3GO2/laATm5LBmhLE49SsqsLwgNfyMvR9vfdaDc/LTeBcuI2Aqd/LCg==","X-Received":"by 10.28.151.198 with SMTP id z189mr1271315wmd.133.1505381423211;\n\tThu, 14 Sep 2017 02:30:23 -0700 (PDT)","References":"<1504198860-12951-1-git-send-email-Dave.Martin@arm.com>\n\t<1504198860-12951-14-git-send-email-Dave.Martin@arm.com>","User-agent":"mu4e 0.9.19; emacs 25.2.50.3","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Dave Martin <Dave.Martin@arm.com>","Subject":"Re: [PATCH v2 13/28] arm64/sve: Signal handling support","In-reply-to":"<1504198860-12951-14-git-send-email-Dave.Martin@arm.com>","Date":"Thu, 14 Sep 2017 10:30:20 +0100","Message-ID":"<87inglaaqb.fsf@linaro.org>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170914_023045_780351_408F7ACC ","X-CRM114-Status":"GOOD (  15.16  )","X-Spam-Score":"-2.7 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.7 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow\n\ttrust [2a00:1450:400c:c09:0:0:0:22c listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","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, libc-alpha@sourceware.org,\n\tArd 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>, \n\tRichard Sandiford <richard.sandiford@arm.com>,\n\tkvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org","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"}}]