Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1047371rdb; Tue, 30 Jan 2024 06:34:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFi+fNE1Nghl2MKw/wtDv5a/t/qYX+9s/r4CErM1sjw4u7weLK7/vXfxcCZ/VJDOG9XOy70 X-Received: by 2002:a17:906:6712:b0:a35:2f7a:385b with SMTP id a18-20020a170906671200b00a352f7a385bmr6456722ejp.23.1706625287260; Tue, 30 Jan 2024 06:34:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706625287; cv=pass; d=google.com; s=arc-20160816; b=jvgdF0H7QTecQqPpYcF2QUumF+mrDKkaYrLkdB8R9mPWq0tOWcTOLrrQ8dS/nV2xep YyERcGWSqCC9hfpXlk+385Ak3tprVLEwBjcf5Nlm1J4ezVq3UI0wh1XKoFaX7Ko80zO4 KkD89WfTTd/x3aj0DVjktSEMJqTJeYKDpakYr+wrD9JO4hF35RJ55BwDRcEj5h7dsFLP sETrSIR1sSE5ISZPmEmpxAaPMLvn5a6oP5a/QkIp44PVXSGZzDW/qgqoNgGLwa023Rwe g6BZfjHpgcZEideWpjK7WAYsVvd2hLuIvDxPzsNpsvd+2jacMWRCbU8CZtlYHsmkZLLb gqHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hCS7SaLQaGDVjO1tV6T3XB7tYxf4RTR9txgEDORhW3s=; fh=P3hOhnDFNTU1CcDoxqiBijaV8RLw5aqbWrKCsacJ0kI=; b=qxftk3JFbo4Y4BOewacBQZh5cJuWZVYaW39tYfe37J6T43o4b0R7l7pj3v+d6F8f5M Hn9EvEG9xc00nMDtK7vtiYvHJwXGC3Dfzv9JeKoRKLzaG5vk7kOpA7zQUU8XUKxn5/4r XA2/iOw5cvdr8OEXPOzBoNduB1nNHcZk46l4eNPcJlaaij/U6e0rpXDE17sooXURu4UI VV2e2kVrk0prvrLeUDyg8+5fXvgVYUEF1lMHzRKPGKSx3iD7pnqGhZMfuN1vayTs2llO 1zlssLWvG5+TUVdQbsx6aGkF4gyf93IUd19KPjjyQmZO5TUtUIgENiMiz79swiN5ui+J 4SeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=unimEILv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id xa10-20020a170907b9ca00b00a35d2b03a69si1647270ejc.795.2024.01.30.06.34.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 06:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=unimEILv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44757-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 081531F27B72 for ; Tue, 30 Jan 2024 14:34:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E2677A738; Tue, 30 Jan 2024 14:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="unimEILv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54CF97CF37 for ; Tue, 30 Jan 2024 14:34:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706625268; cv=none; b=LNAHNXs0DD8/D/SH2BIJ/mqUqIjo1OvvhoagqfHI36x5p7yC6Rg9asq/iTOWI6B/uUMbX8yZAAhg6matmSIO1flu62kyxNK7uCquuVlJm2xpp3GlFEPHIJE1ddaQ5dXQWLYO9S9IAeXxanr+ZjvMm9uDUhgVu3gVVd/C2Ss3n/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706625268; c=relaxed/simple; bh=2190zxEd8Xhtvh4IrZjtdwgLMYVBXviRCIAWurSiB8A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jUmVKOR3WSuIxdgtdQ+iJ5ckIObigcbYPRLFaWXCUVNL4uxplYXaud/tJl5f5vmLUcBx/MclmQ96ndsuKARDqiLCyNTRatAq0XlsYrRDntfyNLk2KVeIIT4QPkfPR9KyIwOeTqJC6B9bHyUSzkf6QLYAGjSHkADRiAGRhvZtgBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=unimEILv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8843BC433C7; Tue, 30 Jan 2024 14:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706625267; bh=2190zxEd8Xhtvh4IrZjtdwgLMYVBXviRCIAWurSiB8A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=unimEILvQT0/gUU6fJdAnqZuexvD5RX9jtF5HLO6tJDbj7GL5corGyRLGRKhWPa0q pT3TIecnZ7+5IaUwmO+JJwldFzNUtuvDBNHnRGQN5bwJA1Zbx/MSUHWYf1LVyjMThD +Gp1M+xpxrQW/Nvt8UDsG4hPRApU4F+3kF7XzeTidXk8WztRcRpk1VcvE0RGsMxrB6 b5WfUVhbZoXKFeA0oT9SLvHAdRpgQA1TC1Qf/AoaT9/I0J3kLE9QjqLjV67ETtb5Ab RyHmqRVdNhYsXmHnIX94wHPj/92zvJg0yfHmleORB3KDZtf0A1k/fpV4vqxlH7U/d1 Gk8LNE2t2iVjA== Date: Tue, 30 Jan 2024 14:34:23 +0000 From: Mark Brown To: Dave Martin Cc: Catalin Marinas , Will Deacon , Jackson Cooper-Driver , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend Message-ID: References: <20240130-arm64-sme-resume-v1-0-0e60ebba18df@kernel.org> <20240130-arm64-sme-resume-v1-2-0e60ebba18df@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VG4FkmmLh5EwClxi" Content-Disposition: inline In-Reply-To: X-Cookie: 1 bulls, 3 cows. --VG4FkmmLh5EwClxi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 30, 2024 at 10:54:06AM +0000, Dave Martin wrote: > On Tue, Jan 30, 2024 at 12:02:49AM +0000, Mark Brown wrote: > > + if (system_supports_sme2()) > > + smcr |= SMCR_ELx_EZT0; > Side question: since ZT0 is likely to be sporadically used, maybe it > is worth having separate lazy restore for it versus the main SME state? > (Not relevant for this series though, and probably best deferred until > there is hardware to benchmark on. Also, ZT0 is small compared with > the SME state proper...) One of the advantages SME has here is that we've got a clear indication if userspace is actively using the registers through SMSTART and SMSTOP. We only restore ZT0 at all whenever PSTATE.ZA is set and the strong recommendation is that should only be set when either ZA or ZT0 are in active use for power and performance reasons. While it is likely that there will be code that uses ZA but doesn't touch ZT0 I would expect that the overhead of entering the kernel to do a lazy restore will be sufficiently high for it to be an unreasonable penalty on code that does touch it, as you say it's not *that* big compared to likely ZA sizes. --VG4FkmmLh5EwClxi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmW5CO4ACgkQJNaLcl1U h9B+7Af/SN40T6oVk2GhtivoOnp8totsJrKK6V8RelC14Ob1Mt+jzG5v3NjGPFHa bTkFF98KZowT2rECsOEwdt9wBwPV21FKaB3LWTZ0Ex4hjGohFfKfB7nxz30nDHCx 4uFmtRLulE0UQ1giANwy94wfmUnzb3G2t1vpAa4tUliwejZdCQaRactxOuXBIQO0 nwtq1kXYi1nmWWmMBhTNDQW2YtpFL/LZKpJQ60Z5doisyq1I+b4rVdGLtCO0VEpC +SaGZoCmZI+eixiL7dxlkEQ8YonrR9p7mOO217Z+KueqOqtsflFa864abxADkn7y /keIoZmj8AtVYPFvKVtHN+ZCQx6ozA== =lbgD -----END PGP SIGNATURE----- --VG4FkmmLh5EwClxi--