Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3085738rwe; Mon, 29 Aug 2022 05:42:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6WpwDiERbwGtY53lW3eOvyy42gNSTzyKtSRn/NuRreedds098+MpyocuGzihI/Jxmw3uZs X-Received: by 2002:a63:d0:0:b0:411:f92b:8e6c with SMTP id 199-20020a6300d0000000b00411f92b8e6cmr13672388pga.108.1661776960102; Mon, 29 Aug 2022 05:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661776960; cv=none; d=google.com; s=arc-20160816; b=yTI+L8AhWawwr1h5xCOF6xASyWDd0iCInlPsAL47oWiN3F5FKVqEUFnPKD3Ltwlh3E zpGD4OvRpprWnJIl6/nD7KwzI/LRR7NcwQINr6GMSV86+GT+JHVnGX8/xoSNoHGsjbkt EwQQLWVE8eywNG4MfFl1URFUBdZrM/iLmBnpkaxuDHiYmSacXvCifpA/he73SA3BWQ0C WA2parPzoo+ycMB65o/7faacqH77Cy0we3KsPg8P/i1jy082gHIyBIj7EzpvBG67U8mK VcxmEfXLNgEsGY8Lq78PLfUB43OqIyEcUoxDCV2UaonyiCmLCBMFYLk5iadjdkvtwwHl uJSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z9Yf+aUEEJK5C6VMObAP/aCFS79P/nfJpMPGRa6z19c=; b=pzqhMPz6MkUTIlq/3CWUKz4cQ/e8wR20tusrShPLSk7Nljb6oB8F09+vuLXDj9Sumy 5T1QnXqRGvmdElCLjuwHR2zmr1KG/0LBu1YHkWXqBX4tKIslCo0DTccl3XaokcJMo9YD Tf3XquIqCniDZtOAX26I+rkJSxPmNEoEyxV9PoOYlUpEdW20P/cZQ+KvILHonA5OTZ6A 8X25P2DV7PCM2rx60Pd161UZDcYYzOToaaKMFqfFv39DwWOYUfDE091/ZL1V6MS6fIBa anZ70OuMrWl91utAvp+8nstnkHrDQTQjJkM314AjVjbfA8wlkRrymjG1KF6eKhKlyWl4 nYtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=za5gNvZ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u13-20020a63234d000000b0042a0dab10aasi8959865pgm.482.2022.08.29.05.42.28; Mon, 29 Aug 2022 05:42:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=za5gNvZ2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230498AbiH2MLJ (ORCPT + 99 others); Mon, 29 Aug 2022 08:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiH2MKv (ORCPT ); Mon, 29 Aug 2022 08:10:51 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 970D212AC3; Mon, 29 Aug 2022 04:56:00 -0700 (PDT) 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 9248AB80FC0; Mon, 29 Aug 2022 11:19:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB70BC433D6; Mon, 29 Aug 2022 11:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771998; bh=aDwsei9jj1VM0sDi6weamcc36m6qy+WE/5lzoysGsuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=za5gNvZ2gI2SMARlLorRbs+qfMNXeFg1cXsWfgHIpnXmqXo+EUTlNpQ83dTeRea7R xDnmaY1ERfstQaGcKjlB1OfoDpyUWsKL44e58/oJU05fuxOy9Vr46/0fM0lxFy4j9y pBiKhObj3bdYt0PhFmtr95xVViLzB+86hG6jvBXk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Catalin Marinas , Will Deacon Subject: [PATCH 5.19 150/158] arm64/sme: Dont flush SVE register state when handling SME traps Date: Mon, 29 Aug 2022 13:00:00 +0200 Message-Id: <20220829105815.393027245@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Brown commit 714f3cbd70a4db9f9b7fe5b8a032896ed33fb824 upstream. 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: 8bd7f91c03d8 ("arm64/sme: Implement traps and syscall handling for SME") Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220817182324.638214-5-broonie@kernel.org Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/fpsimd.c | 11 ----------- 1 file changed, 11 deletions(-) --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1463,17 +1463,6 @@ void do_sme_acc(unsigned long esr, struc 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(); }