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 3FB6BC19F2A for ; Thu, 11 Aug 2022 11:05:54 +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=er3NdUKsI5gPI/qWUpRBbXFt0EhJWNMGM6pJrvU9NJs=; b=G8btTk5FmFj/Ef IBpncjTFGcccWOACkuk3A0jxTwlSN+ekGQ21l9+/pJ2EF+Qec2B+XwWnWPoNY0DpAMTeeZw/RPXBm +fJ8FwQgdptFfixHZZ/DJ7cwGWZiw24GTaMcpLADOGsoVfFm380sWPEQbE39quaQqP6wUq2DWnOVC D/h6eZJ1uN4qWP0+mHN0OIRuHXxmqZS8ds4dmZvBVZQwH0o09ALFP1O50ppdc3UKj+8+7nk+UdCCt gbtTz49fTzdiGRsApGx2BySLiZVPm8SjeXHls72mL8CtIEvEWtuHQ2tfBwdonVUO0M6seqfvQTsVE bPozuOloMM+h18WeYI+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM5zg-00BT8J-Od; Thu, 11 Aug 2022 11:04:53 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oM5z5-00BSnu-9W for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 11:04:16 +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 DADCF61058; Thu, 11 Aug 2022 11:04:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39AAFC43140; Thu, 11 Aug 2022 11:04:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660215852; bh=Utv5oLIzH111AusCO9jzQvAkyjg0c7KS+IVJ/yrjMVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQh1P4vuasBlhkr4ppKu3SsohQ2lur5NBPoax+eQh3EU49u2Qhn+WocMAEmdRMzKw HYEdCh02zG1YmNuo3ssSgVjva46k+DYx/QOlODMBynoEZzsKdYYnnOSASG2K26giHB 60c/URIUefrBlgq9NuyhPj3AvaUCCFMl0+iStCsRb9ym/icsf27gv0icnLNrH78bM+ s6b5n0DsW4cqJYeg7n1SPCNlJWeLPiOQCvPjt2EcRYNONWNAdruYdr+VvxIzYISs9X f3q4G5ZgST5pbc+SCgIXrZ2MlQJmczHVhiDuKErKcdaQZW1pt8k6aWczctoatoNuHJ OtM9GhCXuI6dA== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v1 4/4] arm64/sme: Don't flush SVE register state when handling SME traps Date: Thu, 11 Aug 2022 11:57:51 +0100 Message-Id: <20220811105751.25081-5-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220811105751.25081-1-broonie@kernel.org> References: <20220811105751.25081-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=Utv5oLIzH111AusCO9jzQvAkyjg0c7KS+IVJ/yrjMVs=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBi9OCuFXkdwBmWcdpmErI1q48z0pVfiQPIAgoE/5Vh jxWF4wWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYvTgrgAKCRAk1otyXVSH0ChqB/ 9iw2CMDyodbZtMR5Zum2rXl2kkdXXwzJeIv80sz1p1ZzNSoDscjlh3n2LygkXOR8N6lQBrl999mFXk 6yZLz+6ORiO8yev+Gg/zGz2pcLM6STZ82Cn9OdR49xe9QN1Bc8Nu/Bq69o5kqZ37Xld0nSFi4GY+r9 dl50xlY+0ed7R/lrRIo+CdfCpUXwkCDNxgXN8eskFWbevJid5DumIP3Wkt94kgL42hMBUl0GlRm2i4 Hlkin7Y+7rdOCsOxuKXd7xR1jbteKrOJRfz6EX8wd2iX/8nWwIT97ltXlr4+57UGzmEGreaGLtLN2A 9D2STG0D37bgFBtHkM4hv4V8VZCmgL 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-20220811_040415_401260_FBB5445C X-CRM114-Status: GOOD ( 15.72 ) 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 763a4ab557ec..52f7ffdffbcb 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1463,17 +1463,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