[{"id":1768453,"web_url":"http://patchwork.ozlabs.org/comment/1768453/","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":"<libc-alpha-return-84598-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-84598-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=\"ugoKjjUG\"; 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 3xtCv822pvz9sPt\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 19:30:44 +1000 (AEST)","(qmail 22196 invoked by alias); 14 Sep 2017 09:30:37 -0000","(qmail 22115 invoked by uid 89); 14 Sep 2017 09:30:29 -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:references:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-type:content-transfer-encoding;\n\tq=dns; s=default; b=Ic7WcGRjpPnQipFyARw5f/Z5fdrwIH2JU3xjD5FVQJF\n\t3CncGZQ33rm2yCFMnklsHksijqJhe7fAsSD+G5QrJe0HKR+sAPJwwh22ewLTNV+M\n\trOqV3Ucctj3uk7GWefJ/ZLlKR+zdCLnmQjJAfS6jTVCT7ZoeobkAgu0D5jogYyvI\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:references:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-type:content-transfer-encoding;\n\ts=default; bh=ZdpgL2gTsLoy7RJOFqJ8a9u/Pq8=; b=ugoKjjUGB9pcQQKpX\n\trCdzQReS4a9O2rJadOq6DYTUJA1ZHtbRrlRhv98l75GQlK52LySHZaRAR9nmHvJe\n\tXbDl+c9jGVQXZvpk/mRiLIqBq0uUBHC4NovacCtgY5ok88Ar8gP56Cp0VDRKip/1\n\tpK9cfz10AAho0FfVB77I2zCriQ=","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=-3.9 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=population, racing","X-HELO":"mail-wm0-f47.google.com","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=Mf7/E7gH1FPAfl8Mf/nsR8ToJ4Qcu2nqFpYxorUleCbA2vySBdZU+OCV4xBdnsUIWi\n\tC/P21wB4Z3wamST2sbdpAdYf1ze7ZxtmOsBKmGoRrGrEJZUyCYmeJmf8hNDiVE1GugQO\n\t7oNq4tQc1DtXzLwy9+srpFyU/JkXAoHJ2e3yYnSeFtZuf8kI2n71AcG6dYB7czGmYcKy\n\t+51b1MuJuZDsncMYOPViWl5pJDQx5BXhQOsGJLt7Fnanfthuycn76bcSb4kyxj9p90HY\n\tLsF+1tNFhHwv5iZWfCc/u3B94tz7B38H+cRS1nxxZJWAH7lJnmRsQ6mfCBi8JOUQgBCC\n\tQwIA==","X-Gm-Message-State":"AHPjjUhHwsoazKdJU+9p1KlogO7Dz4cH5psIP4BWqm3KVwdxnnGn6cw3\n\tZX9ctfWFzQm0AgAteXYPkg==","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>","Cc":"linux-arm-kernel@lists.infradead.org,\n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will.deacon@arm.com>,\n\tArd Biesheuvel <ard.biesheuvel@linaro.org>,\n\tSzabolcs Nagy <szabolcs.nagy@arm.com>,\n\tRichard Sandiford <richard.sandiford@arm.com>,\n\tkvmarm@lists.cs.columbia.edu, libc-alpha@sourceware.org,\n\tlinux-arch@vger.kernel.org","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","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit"}}]