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 DE2AACF34B4 for ; Thu, 3 Oct 2024 14:51:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BE266B047A; Thu, 3 Oct 2024 10:51:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 747F26B047B; Thu, 3 Oct 2024 10:51:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E8596B047C; Thu, 3 Oct 2024 10:51:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3E4476B047A for ; Thu, 3 Oct 2024 10:51:05 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id AD8D814185D for ; Thu, 3 Oct 2024 14:51:04 +0000 (UTC) X-FDA: 82632578448.24.8EDEA62 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf01.hostedemail.com (Postfix) with ESMTP id F0C5C40019 for ; Thu, 3 Oct 2024 14:51:02 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SozEYIMN; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727966957; a=rsa-sha256; cv=none; b=XtDRAcacrjSIHXm8w0rgcUuCWUzdWCJ1SQwFLaAHS5qt3uXg8F6cd9q4z9pIQWPkUSzJjB B1DzzVorLNyV+jtiZkYP6tk6cza7aYxqh+k1jsQbUPsZS3vIH4LyvefXyo3PJryselXEKh NCcrImSxDeU8U13UsVi8kLTTCyDRn+I= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SozEYIMN; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727966957; 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=zBy8U2QT2idSi6k00Xily3obZRBMVjMdIGzAM9UJgIo=; b=a408ksLGjV2bCrS5wqYMco5Bg/7bAf3eMXq6kVtM+m0PN+KPGf5Bv/x30QDnSx5hzEgpkn oucNI3VtRKE8eUEtf414dc9VKR+6acCH21DrfjRQiRBw2x6DD1AFkboy6C2celuW/EWBVS OvTB8pLjP5goKlw351JSe4Jk9VqUJI8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 92B8DA43F2F; Thu, 3 Oct 2024 14:50:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E93DC4CEC5; Thu, 3 Oct 2024 14:50:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727967061; bh=84mxqz11Cs3IrhMMq/BoLGimGyYEOQcc4TuOpIDegpo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SozEYIMNfQdA08ap8zdn8koBK0e5WTFzbIvCrwSxzNz2okoVA4Jx2ISGiwZcQMrUP /TLWP6uF2cb6g0RNpjG4GheIE3lAb32d74kKnEgOKsiDOPJe0zDlVAmWLdr2dGh8lk U9TRTmA/9PqNPDvOaDo7Szldk08hT7tOyKoM0RvAYRBqtvmtNRpoEhRJ1vTST8kSbp 8kePx2BdLGQOLdH2pvbKe5TaKxhNT1zvBzqboN5sDp6/ze1cLtrOXfBr55ZZAuxDw0 xK/xXsog4yA9O6+RT0K+o4ID+cG6v8tIPPKVpIDa0N4xb6B6bS3JHGF5xok5wdLF1A +oqqmKo+tGMiw== Date: Thu, 3 Oct 2024 15:50:47 +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: <1ec14d13-7db6-4642-a14b-db8ae362e594@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> <37fbc082-6bda-46e3-9ee7-9240b41f26fd@sirena.org.uk> <868qv6717r.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Hfl6icctJG+FIkDo" Content-Disposition: inline In-Reply-To: <868qv6717r.wl-maz@kernel.org> X-Cookie: I'm into SOFTWARE! X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: F0C5C40019 X-Stat-Signature: rhuyu84hrt8reutrsrs1yi8ycdhie6hh X-Rspam-User: X-HE-Tag: 1727967062-70180 X-HE-Meta: U2FsdGVkX18eJT7mgtY8G1YSBsqOFqRLZwCpFqpWbnFn6ewWS1gXWVwkO5mFd+tzDuhOlRgipQcA49szBwfIEaJkeQS901htn0xJNnY8wNr1kHxxG00RU5IRX0MfwOUSADDSE3DrwpsDfxxg51h2c1WtrME4GhN3o09rFZsqBeHTQoHdxu3fjXXKEzmiy+XEkL8jbt8s5/zsrmLQNxXtLv3qnc/IAfLtS7Xg3aMqhdjV52I30ktHr1VJKCxlETgm4kxW4Uir8PCtESIn9jdmWVAhi80h3KUPrVjNr3DR+yTklwnf7VdSDwUbaWGqlbCLEOnKhEwf4ppWfX4ulzSQuK3MPmpw64pCU4cehYoJ0rWLDHW1RxX9wZJ3gDXxGOwAAx0jgGm1IVcKIx7rg0i/LskDWN9tIO+spPwOKC99Lr+Wfja3KIN23RM3+10Zfi5GfsoBb1ZT4ZKH0Db4IqjdXnMNARKCTfaQYimmnPvgi0kXZLuQDe7llO6YEMPvnOUaAct5BniPWW9PqYMEeFjV5OftLvRSuHZvefvcbwv0l1t10c0TpzdYMwFCJMrSlsPKatVAcY2DvmjdQe/3HpHKA/YjKaycrbglIvxZFMjd9/28uhOQpVXJ29lXEWQ6JuZB4kEyFpBWC/AxLMr735PWLIx+m4JXUenY6apRj24NJ2D/gkX/DBSBDOgH3vtznm5Hqxb3It45X4I+77u56pwNaSJv3teyHB930+pOKHADE2KELgjf4LQ2EQ6QqoGBMCLnR27Z5RZBfGbWODHI47vb7LOy+d7s+C6Mgsv9dDzYkLsCKIhP4AJKLBEvJq4PyVNaK67wc2pL5YqYP+1OkRpdukngaKJIqBWProvz8EGKkhVav2idmUTl+ae4PN5emj8DSflwsLW9sxmbF9ERah10xrWirLP1UZ4ztlraERfnQab8TbgakSBCcu80Pxj0JUNU29yZKUE6BEybDGiii0Z +3FOLkwl fDKERkhTULiRTdr4XBA3OhE3E0AfWTcWoxjePeXW/QAonHcJnE/1/o2SkaBsOyEc+3Xl+ZmH4ufqED+k+iv0w7FDGWmnY8LIx5VRf6rH1+cUvqG15J65Def9KJISqSuQxZWcSPqmC7u9vm7aBA9Ubt3aff+XwRfZG11PYYLnY15cA/v6HnW0J+3n1HfXwy7gSuU0ZaBkWqqHlq3YVv1PfMdWxlbugKWsICPdnHzqtaAjRhVekcDUXoz94zeUjnsg7tCb5dwVKgglrAjiVuX14e77QOdOGIQdsrMnmLUdZRbGKqoVKZiHCcRukVMLNb1wOXIIq863eRAlESxuRtzwJ08EX4KWhuRiusaPYRz1Igvghgwb5AUwU8uHml9r37sZdoNib6sph/+xZBzJGLDENcVYSR4ZlXEfuuy6Y 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: --Hfl6icctJG+FIkDo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 02, 2024 at 08:29:28PM +0100, Marc Zyngier wrote: > Mark Brown wrote: > > 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. > If the encodings UNDEF when GCS is not implemented (i.e. they are not > in the NOP space), then all trapable instructions should absolutely > UNDEF (and yes, it is worth the effort, even if it is only to > demonstrate that the architecture is sub-par). Yes, see DDI0487 K.a C5.9. If you're concerned about being unable to generate UNDEFs there's a rather large set of existing extensions where that's not possible, most of the hwcaps in the hwcap selftest that don't set sigill_reliable but do have a SIGILL generator for a start. > So I expect the next version to handle traps for GCSPUSHX, GCSPOPX, > GCSPUSHM, GCSSTR and GCSSTTR when GCS isn't enabled. OK, I already had that change locally after your first message. > I'm also pretty sure this is missing some form of sanitisation for > PSTATE.EXLOCK, and looking at the pseudocode, you seem to be missing > the handling of that bit on exception injection. Ah, yes - I think I see the missing exception injection handling in enter_exception64(). I'm not seeing what you're referencing with sanitisation though, could you give me some more specific pointers please? --Hfl6icctJG+FIkDo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmb+r0YACgkQJNaLcl1U h9CPnwf/RsvoCd86wK5IpYW+I+BQekRext2o88ILr987SA+imxBsKq7L8n9hdvkg XOQxpyooxGUM9SkA9nuEFp0h5XNzoKf9AgiI+7lypHe0Nr07zzVdh4oq/A5WuiKB v231xK6ewa2AEAEvwwYxzafSbmn7fU0Cbjg1+ioSRCNWAa5XVA8rEFJX8ND6TVff pzx8UKtoFPltnc8jZHY/cPDTnXHvugmZiz/FC/9KDy/hCmuTCkYJBstD1zP9g3f0 1e3X2QZ804cZ5n6MGJSpU3ReexcVxbVoXsdiZiV017zmN6qUMnjJnQJ/NknLUWdK 80HXbpm8hN30vdK0zT5J7KSqtxLkzQ== =8W1g -----END PGP SIGNATURE----- --Hfl6icctJG+FIkDo--