From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2F5DCEB2E2 for ; Wed, 2 Oct 2024 18:24:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88DE46B0429; Wed, 2 Oct 2024 14:24:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 83CE76B042A; Wed, 2 Oct 2024 14:24:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 704BB6B042B; Wed, 2 Oct 2024 14:24:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4C01B6B0429 for ; Wed, 2 Oct 2024 14:24:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id A86CD1A0DCF for ; Wed, 2 Oct 2024 18:24:27 +0000 (UTC) X-FDA: 82629487374.01.9800811 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id E5DAA1C001A for ; Wed, 2 Oct 2024 18:24:25 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HpLyxwDc; spf=pass (imf18.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727893401; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DS/f1cWeYOtLgZZ+avHmWCT21fJcfStwzCx++XALbVw=; b=8HRdMcBN37O12uychOkhrGuIRVK9phYNhP7PYFp62g+a/E85yV1pOs8G5mp1Rs4UZp7U6y h0isyVkaV5NAOVNEjc5pVVL2r7DTod47nPlgpdAzuEsExwKN9QTXADhZ52gY6uz4v96DJH kkVZcc0rJj9bEUeUrB0z+TpdlDMC4og= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HpLyxwDc; spf=pass (imf18.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727893401; a=rsa-sha256; cv=none; b=pra6gHULk0DYRqO1vFbz3liHhkdHOp9Vc930REHgqOf1IpkKwm4LvCW3pHim9kFL+X1k0x 6Yz3gDJutJwdoonEaT9xGlI7nneogw6fiFQuRk70tPNLgxXfUg319M10ekNTV9gD80k/Kd r2XqGtqABcnmeH5CZ4PRBw0UpWIRazQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id AAAC65C118D; Wed, 2 Oct 2024 18:24:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4524BC4CEC2; Wed, 2 Oct 2024 18:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727893464; bh=Xn5r/F/y3n+IVpjGqNQ5xxlIqpNtWX913WJmrs1pThE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HpLyxwDchSeqF4R9rk9zqytwWCTBbpujg7WnOnXPszioolkSCIFdMKzkLWZeF4ohP PssFFutZ0TqK/qn3q51d9EEuAw1pmYyCIWQjcAmufjUCC0l618/rZcYNJWnnizCg2G 1CNq7+MXFCmw+6MEaE1iTjnB6QQMMH8g2IbrGHBviaxXC3DKarwixTHZrjcuZIVaF8 uykmFydsc/VUQbPXgNyiEqKDEo6UDITxmpz1IbAxb3J0yd96UH6KQ5fJ2jmwinS3Lh bV3306MvladnEqvxq3o8HLRZ428Zey8544gcd+Ycx/nCEeiynVhb3l2MR99n+DXhMT 0AeL/bD/KzbNQ== Date: Wed, 2 Oct 2024 19:24:12 +0100 From: Mark Brown To: Marc Zyngier Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , Kees Cook , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , Ross Burton , David Spickett , Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v13 16/40] KVM: arm64: Manage GCS access and registers for guests Message-ID: <37fbc082-6bda-46e3-9ee7-9240b41f26fd@sirena.org.uk> References: <20241001-arm64-gcs-v13-0-222b78d87eee@kernel.org> <20241001-arm64-gcs-v13-16-222b78d87eee@kernel.org> <86bk0373nq.wl-maz@kernel.org> <86a5fm7b4i.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f644fc4VKEnWPPLA" Content-Disposition: inline In-Reply-To: <86a5fm7b4i.wl-maz@kernel.org> X-Cookie: Know Thy User. X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: E5DAA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dWvnoNhcINE+6Gi/Dc+yZXISLl4RM2OMJca0k9ftvrqmNULOgFNEJ95dTOIqtuwhKiqLGf2sR6Kp0h0uSqJ/5OVXvrYQBq/mbZPemlj+TRqB90VvbZ85jsXnju/XJJJmdgLpqS2Nb7pE7E9zBNgsciDHaGOCKPbx6/TKfLIRDbN/40LtZ2K4cNWrw9exS5ziugmmtYnyS3e6/xS9HAMTebOcf5HfewR2uORJ/o1mLRL4+EQEE486h6JZOnpI0L7VokuCppxt3SU357ow+QUTpGCUrDlLR/pgWL4bM8A0LEsZj7rNlrRNicrbgQ82BDobqiowDQ3NnRMcEESZ21+foKRCOFcMTN0QtBtBVFzLuXr/bpAZ9+qwLwqI0p0HE5fsFK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: --f644fc4VKEnWPPLA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 02, 2024 at 04:55:25PM +0100, Marc Zyngier wrote: > Marc Zyngier wrote: > > > + if (!kvm_has_gcs(kvm)) > > > + kvm->arch.fgu[HFGxTR_GROUP] |= (HFGxTR_EL2_nGCS_EL0 | > > > + HFGxTR_EL2_nGCS_EL1); > > Why are you still allowing the GCS instructions when GCS isn't > > enabled? > Scratch that, they are NOPs when GCS isn't enabled, so there shouldn't > be any need for extra traps. They are, though really they should UNDEF if GCS isn't there (which I had thought was what you were referencing here). Equally we only have traps for a subset of GCS instructions and it's not like there aren't a whole bunch of untrappable extensions anyway so it's not clear it's worth the effort just for that. --f644fc4VKEnWPPLA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmb9j8sACgkQJNaLcl1U h9AOWQf8DFoVOjrYp2ocafOH0wTbI6Jawr1ucPRjwYcn5sAGuTLywrEihNxOR42y l62ygvYkYtUWpgViQZqrQznNkYbdxg7O6dnvc4ywKu0iWo1KPVJFT0At7NZp6Pxy z8z/9OOYjxelIy33541t+XgjS3MxR3LA2PJSZd7ZOd4sHZMl7t1oLNi/s9HV0LAK /xkcFEkwnX1y0EndbVnntD9crF+J0pBIuO1z3wtywncxixscc0PgM3e1mvmTmYu6 k62weouXEqlaiF5DZ6hHH4iHj8mPMYlnmvEz6Dsiev6PWcCm2hYrKiIO44ThjQJU OggiVTV8pqPtukHW/VmVN/VFPC5k6w== =YDrc -----END PGP SIGNATURE----- --f644fc4VKEnWPPLA--