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 D6B96C25B08 for ; Wed, 17 Aug 2022 18:25:57 +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=MWTnwRwTXOYobu/UjtjUvQu0o1ogMhiCDrl+0XkOkSs=; b=VR16RZWbamZMru wYSHo6o3qzQsJuqRq4dQj6z+LMfy8KJtq7EY1GcVkXKD1jMCgXVhk4NQ1vE85lL1v5BgcvVBNiQvy 6mINGUTLQ3PmPsdRqxlb+GSe8prMXMskVhZ5LrVAV+1uIqXj8ebiq/jXgkZ9ylEviHPMoYMoj7MoC lwph81oVBRzBN7aeANj9xAd+U1BcM9fSafPTJ1K3ejgQ34TDyNZjQVAyCknyh2QHclla9pmpCXP7h ZyxvUzX5v7tqw+tNSWqC2W0c4/DlIyJOFEkmZsUmVQIM9sZJ8m1xFezpYMdlSLhAhevt/Qlc5oDaZ J+QkmApTwDPQYJEst1wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oONip-004wqN-Cp; Wed, 17 Aug 2022 18:24:55 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oONiP-004wUw-Fg for linux-arm-kernel@lists.infradead.org; Wed, 17 Aug 2022 18:24:30 +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 ams.source.kernel.org (Postfix) with ESMTPS id 2D41BB81EB5; Wed, 17 Aug 2022 18:24:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8133C433B5; Wed, 17 Aug 2022 18:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660760666; bh=IP8nv1llno/Qxs52ZO0yk82SKD5vdDs0KRUV0fC5dlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UtHrP3ybyZs8+I9GPAWiTJZdhYRn009JPkjRKq9w7qzNrGalYyPDkGZ2lxyZJoolq ab9fvK+qWaCE5IoP5h7O3GrtV8gbGzZWcMVRIs8PP55Ihu3sJUBmFZochLYHzkwqls oX+XSC+5OsUruh2xnQhDuDTDlcc2IpR+OtPD+dhUWMSnDyNcf8D6dhsnu7VQ7T3yzv MVYctEvPzlP9sJbZX+VqNoZy9PbxHSbdAlkHRpd6w6vw9XaBbpNHglXDJyo4WAqj9T mUcfdsJLBFeo1n+eM4kx3MUVsMz7RbMGvDDwBGRm/LVJuTaCTlJCl1qrVWl2K6vnEL uvovTq9QaVn/g== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v3 4/4] arm64/sme: Don't flush SVE register state when handling SME traps Date: Wed, 17 Aug 2022 19:23:24 +0100 Message-Id: <20220817182324.638214-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220817182324.638214-1-broonie@kernel.org> References: <20220817182324.638214-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1600; i=broonie@kernel.org; h=from:subject; bh=IP8nv1llno/Qxs52ZO0yk82SKD5vdDs0KRUV0fC5dlg=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBi/TIbQT9D6FJ4o5/tVx3ctaLC5K0bte4Db/wCCtSc txICU+uJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYv0yGwAKCRAk1otyXVSH0CZ0B/ 9CDqstFonZZ0KGW5XjTKKEcsahHuVs3DbUN6nkORkkxGGix3GlF1j9Tgy77exzSqdI9F3HYmEwqBu2 4wZA50A0R+wG9qk15JNN7GEtlxvIwspdMp0fWIHNGl4YFNQlCq27ucSOrHpWWcN4/xesSA8Gwv3UaY 5CIzNahJiw3EZplCZ3GdriBZlyCyyax8L1Ew+iOMEgAFqJbF4hYSFHV52LjLRzkBZJT7JrTOssc7jP 5eGMylUs5H4cIHSZEehGzM4fn8H1KOOzcIydNVQZ0Ne6tjOnnzC1+8MW09kLi9n2iRHoXKmCbJBN98 9NQvX31B88NGgfWEHCP9cS9wrHUJvJ 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-20220817_112429_713416_DB8033D6 X-CRM114-Status: GOOD ( 15.18 ) 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 Reviewed-by: Catalin Marinas --- 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