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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42DC7C43219 for ; Tue, 15 Nov 2022 16:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QVuymDnxOTeFoXux3Bx8WGGhuM0Vclm1SLJ+ftQdk8I=; b=psyNSEyM/k/1tRjJ/TYRuO71Ag eOovrENhHEBwufi6v70yH6Hw+rAFVxNGWWvTprBWKauy84NjqkbsmFruM38iBvoam1aBJZNTD+dTR uOuTjpoDbAohgH1JHzz1DaSg84P/xSTnTbOyqvLp1ElLkzPGohCJ/qhoaisj5iVLrWE1/V/NCDupK /OLUhgd9aMkxNf/UMmZtTpj9boRNipYeZKBh2pI+ZddOmMTUA45GuT54Aoi5tT6c8TJoMDChG2U++ QwbL7UW06SWoD8jkJrPIRy3ARHpAJRT3ibBxXNGfCoIsbiwJCXBAXQzGgtbqPA9ZcKdXE4D/r3dY5 shK1zXAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouz13-00Cyv9-0k; Tue, 15 Nov 2022 16:42:29 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouz0z-00CysD-Vk for linux-arm-kernel@lists.infradead.org; Tue, 15 Nov 2022 16:42:27 +0000 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 sin.source.kernel.org (Postfix) with ESMTPS id C3025CE17BB; Tue, 15 Nov 2022 16:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4B69C433C1; Tue, 15 Nov 2022 16:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668530543; bh=FOFdhqD6m/aZQd69Ybt+h1sB9YZCHUQmR9ncDYFYyAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=t7jWJZd9i3I4Ap18s89XR3UV7z0eRBvHkDtlz6f47iQOsSNhv1l00dBUAKCYczggN Z5T3uGhbxFr+Z+UpaQRvMJXoV6b70E6k8mtWYr6OUion6NXOLYdq72IHl0gditszdX pNNOGb6xa3CBpShfy2zBtqvYzIq8Xm17c0pSIrpOYnrxMrsvmLWSp4Sg48ibZ+x0NL t925WnaMp+Xw0lSzysJ8nRnFA92dKUW6K08vOVu+RHRQQhzLs8jNf9mam5BGFg6ePt 3zx7WaHsqao9ifQ8/RR21Kkj7fiVh4pJuLgohk/x3x+ZJjtIjEeWgVP92UkEiNW6Bx aiHf4MM/JeJBg== Date: Tue, 15 Nov 2022 16:42:14 +0000 From: Mark Brown To: Will Deacon Cc: Catalin Marinas , Shuah Khan , Shuah Khan , Szabolcs Nagy , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/4] arm64/signal: Include TPIDR2 in the signal context Message-ID: References: <20221031201736.894374-1-broonie@kernel.org> <20221031201736.894374-3-broonie@kernel.org> <20221114161005.GB31141@willie-the-truck> <20221115122225.GG32523@willie-the-truck> MIME-Version: 1.0 In-Reply-To: <20221115122225.GG32523@willie-the-truck> X-Cookie: Ego sum ens omnipotens. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221115_084226_416677_A3201BE2 X-CRM114-Status: GOOD ( 24.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5458584877490471763==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5458584877490471763== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GF8QJS9bGAzWujj4" Content-Disposition: inline --GF8QJS9bGAzWujj4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 15, 2022 at 12:22:26PM +0000, Will Deacon wrote: > On Tue, Nov 15, 2022 at 12:08:44PM +0000, Mark Brown wrote: > > On Mon, Nov 14, 2022 at 04:10:06PM +0000, Will Deacon wrote: > > > On Mon, Oct 31, 2022 at 08:17:34PM +0000, Mark Brown wrote: > > > > + if (user->tpidr2) > > > > + goto invalid; > > > > + if (size != sizeof(*user->tpidr2)) > > > Why are you requiring an exact match here? Won't that hinder any future > > > extension of the structure? > > It will but since the structure is explicitly for a single sysreg > > that's intentional - the thinking was to just continue to model > > any more sysregs we want to report in the signal context in the > > same format with their own contexts. It felt like it fit better > > into how everything else in the signal context is extended. > I see, but having the usual '<' check wouldn't preclude us from doing > what you suggest above, whilst also giving us some flexibility in case > things turn out differently from how we expected. This actually also how we validate the base fpsimd_context - while there is a < check in the switch statement in parse_user_sigframe() but we also have an exact size check near the top of restore_fpsimd_context() which gets called from there, meaning that the check in parse_user_sigframe() is a bit redundant. We do however allow the varibly sized frames to have an oversized allocation, though those have internal sizing information whereas fpsimd_context doesn't. My take was that we were erroring out here because if userspace thinks it's supplying some state that we're ignoring and not restoring then things might go badly. I'm not super wedded to this approach but it is consistent with the fpsimd_context handling and I can see some justificaton for it being done the way it is. --GF8QJS9bGAzWujj4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmNzwWUACgkQJNaLcl1U h9B0bAf9Gu8D+h2uANHMwrSpqwzj3Co6szE5u208upqbh/y9/DFZQUsb/kFbJqGy DxygVccyChTFG0zBwaNa/Bs8rKFouDAiqvZ3w7l5fLtPFpKvm7KHOE0b0C1SJ+c5 B4qXMBJGuk6RA2uyYkjZYQbbBm0/+llRpCMEcrLCgLZE4cTScYo7Ght/g9FHqNYI Lj3NAydI0gKwb5mTQXMdEXqT9sJzkjAv+iMnS11pt92QiMV4TIqvblKPVPk9buyf OQ6WGrN6IzqQDb4Ov1V2bfK3VeDO9jRbuyQHP0cUME9T9j91HsHbNqaeE14mQvjI nWfNG+Uy+0h1k4z0fS1fGNDA5BTumg== =tiu/ -----END PGP SIGNATURE----- --GF8QJS9bGAzWujj4-- --===============5458584877490471763== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5458584877490471763==--