From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9305FC00140 for ; Mon, 15 Aug 2022 13:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OqPRxJHGnOJiEPXBBLMD6oDjAK/9Ei8t+5qS1TwC05M=; b=OdMTJaCFCGbT8s 2LwOQNj999oEpK0y9fkroDeQieX47hsxvzybojlVHXqGZW1DO0tasr4br/VeYJ7oaSUQtv8gBuyrR QBgUPbHtgRkG3aEiud9vpQ6cT46ET6I458J1Vn+1k+aYTx/Ojz1T0lOEMJ2at8R7Pscyh9fu3u0TF wdm6Khgc301qxSPptsgA2z+Ch4/cKurWKGFbfEtrGh3b3hIvOmBrgHxHmUky1WvBTOS9n1wkJiJba xmfyBA5E0AQh2cxvRszeB2ahOA3EjBrJmjda8OM937vbIc1ARHcPzGw0n1PiyL4kbqqx/kGU4Qp3U 7FA12TyG42qUEQBySEKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNaIs-00GvnX-Hc; Mon, 15 Aug 2022 13:38:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNa9k-00GobY-BK for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 13:29:26 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9AAC760EBD; Mon, 15 Aug 2022 13:29:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE294C433C1; Mon, 15 Aug 2022 13:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660570163; bh=htL7psde/6m/06hXJ2sMvOQFxJyXUXBrvRidUOXkHBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pxhRLzO5xL8uPOV9CNcYGpKkWPLOSF5peq62yr9DS6cjdEA2fJsyybby8U8EW5tNq dOd+9y7kvrgharBTy35sWuo473onJJKBbdDOPoNMlXzRWzSlDU/P1HiYsArEK0BH5C b9m3EOEdEFpLo0hhdTbkQnVZ6MBkeac/SL8sKWRz3r3lxoATFhAm9Kn1eR2eFkuZ5u jaaeFJK2Od1GJS+O0u6DUcle7p9Lo4tS5EGDQSV/37DES36tQpY88kWnwncpgKZzla sOPqmBHif+bapRXoEuR0TrLBoDdCDDY6WWtQ9UKEBVyn0GlDLhgd3+GZXQsl9MmrPz OA/xHJWTf5Qww== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v2 4/4] arm64/sme: Don't flush SVE register state when handling SME traps Date: Mon, 15 Aug 2022 14:28:34 +0100 Message-Id: <20220815132834.229769-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220815132834.229769-1-broonie@kernel.org> References: <20220815132834.229769-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1544; i=broonie@kernel.org; h=from:subject; bh=htL7psde/6m/06hXJ2sMvOQFxJyXUXBrvRidUOXkHBc=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBi+koCV3ETABnNodFBFiLvj0xMvREQEsE8BVYRYezt 9U8ke4SJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYvpKAgAKCRAk1otyXVSH0FTlB/ 0TdGGiXzemEWVq3144UyKKp1T3n8TCei6Sq/sEh2Sje/SXcpwVem9lfgoEq6T0iRTO2iIitnLjpqRK Ugr0CAHnEiqiIObKDm/UmhvDyiS55uP1t+rDLJt35tN6rQTsAn3P4AlVMGmM5y1psH4WqMKG2EKDvG mTJCI9p/lcjftNOY5JEKaX7oxF/tq4TiO0gBT73Uenz3bGegbmZQeQYEEim8yIqKRF35OA1OdR8T68 hCwwucsQPF8AOEKolFjvzFN+KkAjZWd5cLHQaJjwbn0+usO8x+I8z18a7I/YiPJL/TLfL9DJcl40nj 3EUinujrIv5gnhVXrrA6yz90RkThLN X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_062924_656890_E9F27A23 X-CRM114-Status: GOOD ( 15.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently as part of handling a SME access trap we flush the SVE register state. This is not needed and would corrupt register state if the task has access to the SVE registers already. For non-streaming mode accesses the required flushing will be done in the SVE access trap. For streaming mode SVE register accesses the architecture guarantees that the register state will be flushed when streaming mode is entered or exited so there is no need for us to do so. Simply remove the register initialisation. Fixes: 8bd7f91c03d88 ("arm64/sme: Implement traps and syscall handling for SME") Signed-off-by: Mark Brown --- arch/arm64/kernel/fpsimd.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index b9ae9827e6e8..23834d96d1e7 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1462,17 +1462,6 @@ void do_sme_acc(unsigned long esr, struct pt_regs *regs) fpsimd_bind_task_to_cpu(); } - /* - * If SVE was not already active initialise the SVE registers, - * any non-shared state between the streaming and regular SVE - * registers is architecturally guaranteed to be zeroed when - * we enter streaming mode. We do not need to initialize ZA - * since ZA must be disabled at this point and enabling ZA is - * architecturally defined to zero ZA. - */ - if (system_supports_sve() && !test_thread_flag(TIF_SVE)) - sve_init_regs(); - put_cpu_fpsimd_context(); } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel