Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1071576rdb; Tue, 30 Jan 2024 07:10:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3KvecNiB27vMJsY784s0dR9FbLNSrGN6MwmevsyicwRoyfkMyiF25ZHcL3OWmkz099YxU X-Received: by 2002:aa7:d053:0:b0:55f:80a:3006 with SMTP id n19-20020aa7d053000000b0055f080a3006mr3911437edo.2.1706627455212; Tue, 30 Jan 2024 07:10:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706627455; cv=pass; d=google.com; s=arc-20160816; b=n2ILD+9D9Gr82MQ9V8QuSJ16Kt4ITEzYhZAcHB6q2Aa21m9/pQA3L6j1sntfP3h5qh BM0iERB03/9FxUwigPtkIAtAhxHH2Bdq719CWBGwZGBq8FZ028SNFVe0Fu7z6KIgvLaF 5Jb0WJVdMw5KFUi55qlx3j7RScLXKWSt7eR6uDYsNvt3rGm6YMAY7kXhI6bKl/gLSLb6 CE7d8U3dCqeguWx0wgVRhhaikgHMMGuBKnhRIwjxc5pz3jSQXyKwnf3LsWGvYV5/YqZs zvLDG4q8veG6kqeRXDlM3E5AowbKaAi9kBnBYG2u/KCWI7ag/X2dnCrMVwcLHMilMeBL Fxig== 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; bh=HHeMLHY9WL9VoetfTfzqbKtLnGSHt3pdV92fdmvz7Vo=; fh=bnH/IVvwu0+r8Z1i/prSBRcbJUIcbweMEga4dAUBuT8=; b=nya5i0VCqGWBMNKoFoX3MO2jX8ZtElblVMwgdzMZcpj4y1aTe8MFTogV30gRhwzAB3 X6GUFR9pooqFpfrhrARt50Qti5vId348enDqIEV8t5+6ipvqIuUMoQHo+Uq4zlpmCQx4 6wgBOT5LSRX08UQO+vY5uRYMWnhilqvj/It8HxWyf9mmDW6rkCdzZqw457sfxSstiq9B +pCXYKxEe7vioGOmx/E8qnrmo/7Ew1YkR7M+s9/XKnYpvzOZzGZiJT/z5jm3HENdYQW1 Uwx2NvW9UGqYSFPlFJypQ3X+5z3t8I01GSHVTITJIhxFqjeSuUtae3tjEKmzeYVq62u7 vNJw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-44810-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 24-20020a508e58000000b0055ef72ed967si2175001edx.309.2024.01.30.07.10.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:10:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44810-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-44810-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44810-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 EF8551F24874 for ; Tue, 30 Jan 2024 15:10:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BFC28811E2; Tue, 30 Jan 2024 15:10:43 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 738086D1A2 for ; Tue, 30 Jan 2024 15:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627443; cv=none; b=ASOXaO1xXDOtePsU33c9o9573s/dNJA3BCqt+88a9h6RlGtFbLOjSqMpmAqUZNWimaLwgJEhlpfaSEILV1dLYtzoTTstNjJkHvuZMt4F4xD7g+PEhWk/m2fZttYJd6aA71Reka3bNtwbIAD4bM9OeBZrRgNQZ+aYw9PRdzDivDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627443; c=relaxed/simple; bh=ew5D2W9FVs4jqMe4LU4sKqMLtY5HWwIiEstbwuA8TL4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uYKz8zfvMwecMEtCys4SrQcSQaZJqaSnqmD9nbDgKBTEKf38ralQce8qPXToW9x0FtJ2ItM2kW48k57ImsnPTo0CGh+pWaKr9upr6B/nhm1Q7thT4ZapqWD3APYpjQmuDxEk5U8LIlC7uVM+wdlGzv84NCua8FNwrhANDzP8U+c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B5671DA7; Tue, 30 Jan 2024 07:11:22 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5ACDC3F762; Tue, 30 Jan 2024 07:10:32 -0800 (PST) Date: Tue, 30 Jan 2024 15:10:28 +0000 From: Dave Martin To: Mark Brown 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 30, 2024 at 02:34:23PM +0000, Mark Brown wrote: > 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 Good point. I was still thinking in SVE mode there. > 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. Agreed. Cheers ---Dave