Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3717810rwa; Tue, 23 Aug 2022 09:01:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR68P0Yi/UY2L0AxSkM2Ynexu2lOs+4MBRtWvJQZTbEndq6jsj+BEGFpC+riYqRs0qACYMEd X-Received: by 2002:a17:90b:48d0:b0:1fb:3853:b23 with SMTP id li16-20020a17090b48d000b001fb38530b23mr3818170pjb.219.1661270467287; Tue, 23 Aug 2022 09:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661270467; cv=none; d=google.com; s=arc-20160816; b=VmaZuttwJPtb1J4QmbATMfo+3bg2uRl377zmCYgTyYjqEr3eDY9YH2aHsJWrJXNLSP aFM3xoNudvl5gGDgZYLXKT01qRA11RrwdqEmXtLH+wBNgHuq2tDXnMywM3SZg/aeuO6k aUMBicDB3Tz8tfrB1/sAsas/ieJdvKAtVTWKZKBC8k22sHtkqxqYa6voiIu7e5Uww8tB MJ46ElLoA2PA+xpqsZ+oKXEJ31mrUQxG5CForezmqxxlpO46+LrMmHzgcsZvYZb2Ty4a yLGRE/nDsy+WtYwcuuf5bWPn+EJ2A2/Xc6/YDTDFJWACh6HBdjnY/EiWxuWc6YbYG0bS 2YEg== 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=W1esdnYK/hdfMilFktVvJ8axOpctgSJU9QbBW+yulSg=; b=H345ED8VfX4GI06oiR2QlzN5SBCRiX0pSpSQ0IHNjhQiUIkFUA7CS0KOX7MMoX6yEl A66FHv37fwNFk8cO8IF7HbKB0OU581d85gRZXtx/1pI+HTOYQggY6Y3vFNx8sHsxqjf5 B/qCcW9K+Jk6nX2oKb+LVrq37psLB8Mwl+4FkcKI//2vvMLazjQoMeApiP8FQbnSqHBa PeBzyz0fjBHTxxKxM0vjbP9oDSCRT6LEgmL9hPDiEQAe8GnYJ13ZakOdlYOK9/GPJXLY 94avGm1VyxovXQf+sZpYaS7E+hpeTJzNzb61Vf+kEaR5bYxStYDpTyCXeJFFMk6drKId ILhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D91VDK1i; 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 i17-20020a17090332d100b0016d854fd13dsi8102150plr.160.2022.08.23.09.00.31; Tue, 23 Aug 2022 09:01:07 -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=D91VDK1i; 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 S238336AbiHWPhu (ORCPT + 99 others); Tue, 23 Aug 2022 11:37:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242796AbiHWPh0 (ORCPT ); Tue, 23 Aug 2022 11:37:26 -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 CBAB6C12E8 for ; Tue, 23 Aug 2022 04:27: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 4A17B612E6 for ; Tue, 23 Aug 2022 11:26:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1606C433D6; Tue, 23 Aug 2022 11:26:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661254005; bh=xusDJzFbQXYfZaVCTdgH+Yb1GNWkV4ady1wSxu89sMs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D91VDK1iDSjUOCqmpN8YS63cSEh0/hwSKJP4ZsVm0AP4G0t9wvFmOkRvHeuGsxPog cFTjBqp6jAYjfWX8Hr9gh2TdtRTpiQZL6IqZQzEN3wxZpsyfVaseZaT+f+XgPGoqUu umkqiU+B4DvdwPaW1RNNn+wCb9UOlAARkDUGp/WvjDMPbn6q3kEuNB5yXK2iNUoiMz t15pz5Wql2MKbAkAj+Xt8e8V1p2sDQ2M8PdybtIcV1j4FBFdFLag02PFIlbCFWkJaD v4v/LtsOocMmltsB7wuBymBFqwhmvia6RokTvzeCVpIOLzBuGviTO3IaQ84a1SjagU M7OtU3GXdVIuQ== Date: Tue, 23 Aug 2022 12:26:40 +0100 From: Mark Brown To: Wang ShaoBo Cc: catalin.marinas@arm.com, weiyongjun1@huawei.com, guohanjun@huawei.com, oleg@redhat.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/sme: Clearing TIF_SVE but not TIF_SME in za_set() Message-ID: References: <20220823015627.4161141-1-bobo.shaobowang@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Grr7xBdWJnPqcDeU" Content-Disposition: inline In-Reply-To: <20220823015627.4161141-1-bobo.shaobowang@huawei.com> X-Cookie: You can't take damsel here now. 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 --Grr7xBdWJnPqcDeU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 23, 2022 at 09:56:27AM +0800, Wang ShaoBo wrote: > Clearing target's TIF_SVE but not current's TIF_SME in za_set(), as it indicates > target's SVE storage unavailable. > +++ b/arch/arm64/kernel/ptrace.c > @@ -1084,7 +1084,7 @@ static int za_set(struct task_struct *target, > if (!target->thread.sve_state) { > sve_alloc(target); > if (!target->thread.sve_state) { > - clear_thread_flag(TIF_SME); > + clear_tsk_thread_flag(target, TIF_SVE); > ret = -ENOMEM; > goto out; > } We didn't set TIF_SVE so we have no reason to clear it here, we know it can't have been set since there was no sve_state allocated. The clear of TIF_SME is happening on the wrong task though, and TBH is just redudnant for similar reasons. --Grr7xBdWJnPqcDeU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmMEuW8ACgkQJNaLcl1U h9A/nwf+PMHHOdTHrCmXoakUYx/xyO07zoxAKWSbovxyoCSP1CReutGiC9tQM1VM zbcDMjxZoxhbyLBuEeJaIPNt0v9ZzN89iSU7RGxS7D+rEv5KoGUGAyYckbKpSYfW ul6Zz4rWh1LBCJwtrq60jUtApmTj+pu8xNKNK8Itd9KC5xia/TRCiVd4DAGvV1j1 pojDGfI1dgPhHUhZlpslMD+Hs3v6w0uQ7jhXcqERSwMuRpxz9FSQ1YIYKYNJg4Mj omda9PxYr5rVMNNbw+DQ1E/LjtKzL+sgl4HWBdiLk8B9maABxnAwFrokHPxLxabS abDtlQ7ReZIHMsIuLbexgD01HAsRIw== =Y+xl -----END PGP SIGNATURE----- --Grr7xBdWJnPqcDeU--