Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp907297rwd; Thu, 8 Jun 2023 09:15:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5++1aytoNFGSGk1Ua2WOpEjPVIfxzkJyozYJQw8pC2E4gbHsaIj7bE1u4CQmEruZLCyjRf X-Received: by 2002:a17:90a:10c9:b0:259:548b:d385 with SMTP id b9-20020a17090a10c900b00259548bd385mr7942327pje.3.1686240935193; Thu, 08 Jun 2023 09:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686240935; cv=none; d=google.com; s=arc-20160816; b=Yg8gyWTBvC/+HyraZHwWut2f/AmsJGzUYtgJyNgDelYxII9TXgyiSDvDmDUCO7Jsne YVEtfRvobxZE4RoSgn5Of4oxvDaAcqCHFsZPj8hGpywd908K1tmmSQzr2ftQdWrqoAje 1xuUGVUMAw0R0FkI5763dJL2V17q4Yw5M/Y/r8+JI/gW5FnKOswzKTD+6I6ACLZvmVUH GSIGLpfQl0RH/VtDj3mtbD+uRhm61A4kkfjmt4KEn09dQUVomZq2CwVsxIB1C3yKVWA/ JZ0JyvMrcc5/2xefYyj/X2lC8Np+gtWTxYaGayUX90qv9DP+Oi0Z7C5q5S56qelUY6D8 8H8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9itYM7TKkXVOP5n1WGOG1qmat/8Ex658tk1+ePqOrYk=; b=sdQwqoq1K2tuToTgtTco/riUX7nluZIOOM4+d8bQZbDVOWwpP0UBHh/jH1mq1lIA1e exYTkd8iQh9xUqZNnI1C8wgj28W/2mxjfOGdn/1SE4p+NAKK5CJXUG1Sf/PQJrrjB0mb upmlwneGE4LxDaIqeftMGiMrHRy81nUynvuIgiTomf7wFj1SoKSeAjc1moBL9D5Thdj7 lzndrsicFFhMPSTQ9iwfWdgJKYP7atlfByOUo2E8ufLIEyCvQ2YLMwVPo2T9vnXFkOJk ENbVFaaD77CB/pJyU8rwHWo14GicbcqnLY3sxdAiPwYsB2xof0mYPOP7y5VpN958SzTD GhzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YvxH00dj; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a170902d58300b001a64fba3382si1256856plh.148.2023.06.08.09.15.15; Thu, 08 Jun 2023 09:15:35 -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=@kernel.org header.s=k20201202 header.b=YvxH00dj; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233006AbjFHQEo (ORCPT + 99 others); Thu, 8 Jun 2023 12:04:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233453AbjFHQEb (ORCPT ); Thu, 8 Jun 2023 12:04:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 495A335BD for ; Thu, 8 Jun 2023 09:04:10 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D2C8B64EC7 for ; Thu, 8 Jun 2023 16:04:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 951DFC433EF; Thu, 8 Jun 2023 16:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686240249; bh=f9H+3yXxvwSmJGxKQ/DBjTp81E44oQegFdzLk3uPs8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YvxH00djkue9YGQvcVXdHTN7IjeZGU+vJ7p7BpnHdFKDRQ66oGKvdmFDhu11LotFl nz0olf0E4qyVQo/9Ro6hHrR3osNuU1meTlOPfNOsmWxDpEUFuozOOcNWWrmYF+8J3y 4b96H3SVLLEgoNKHdG4F+QyGf3TntC+pWXsuVqE1SsexjwY6/YIWGeRCcBzSAkfl71 lwIAorkWSHiwAcQlgExoH3nbSUY2afqpEEZ3CDB3RBuIpkUkL9xWUBmQRiISVrKjFr nEiIZIY8D1StbmgjTtoKOSSWT+B5lY7Tnl5h9fubzZLO5RMpykn30ivmva1TG9BAVi GCgY2G6SLUsdQ== Date: Thu, 8 Jun 2023 17:04:04 +0100 From: Mark Brown To: Mark Rutland Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anders Roxell , Naresh Kamboju Subject: Re: [PATCH] arm64/fpsimd: Exit streaming mode when flushing tasks Message-ID: References: <20230607-arm64-flush-svcr-v1-1-7821a6199e0a@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+qV82rKrOrzP4fh4" Content-Disposition: inline In-Reply-To: X-Cookie: Disk crisis, please clean up! X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 --+qV82rKrOrzP4fh4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 08, 2023 at 04:51:26PM +0100, Mark Rutland wrote: > On Wed, Jun 07, 2023 at 09:30:51PM +0100, Mark Brown wrote: > > fpsimd_flush_thread_vl(ARM64_VEC_SME); > > current->thread.svcr = 0; > > + sme_smstop_sm(); > I don't think we should blindly do this if we never expect to get here in that > state; this is just going to mask bugs and make them harder to debug going > forwards. > If we need this, it'd be better to have something like: > if (WARN_ON_ONCE(sme_is_in_streaming_mode())) > sme_smstop_sm(); > ... so that we can identify this case and fix it. No, being here in streaming mode is valid so that check would be wrong - if there is an issue the issue would be that we're expecting that any further use of the register state would involve reloading from memory but there would be some path where we end up doing something that uses the in register state again rather than reloading. The change ensures that the saved and register states are in sync so that can't go wrong, meaning we don't need to go confirm if there's such a path. Though now I look again we should do a full SMSTOP since a similar concern applies to ZA. --+qV82rKrOrzP4fh4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSB+/MACgkQJNaLcl1U h9D30Qf9HNaYiNl8I7Jcf99d1m8KO85jAobhM+72SBTN8edbhJglkTc2mRy9i9gC e7DwDnjgOvmYLziVhkhuDm+CnAserbwhmvpWWUS42+SKNL3Hl4MRKxvh5T+kYRk2 bblrSpGEA6S763mejnHcG2LkvYZvSuUhh59TdE2aRjqLuxykZhbrphFZK7N8NMYx 2kIf2eZGn1C/y8DqssVBkj9a6rFyTI2oDSqFkLBvcuapRlqUbQLQHpqPPl3FhWu3 kFRd0Xp91uzxc9OosBtRsCM6eqGy/1wF7TiL5UxabwOiEjSL71F6J+LMRtj+77HH LeiuDhu2wzXKYMeN5mxXwl/K51X15Q== =2Lv0 -----END PGP SIGNATURE----- --+qV82rKrOrzP4fh4--