Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2546299rdb; Mon, 5 Feb 2024 09:42:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGchm0ziMAARvBAt4PQrIdBErsvynL+ySrQSkQw1NsCC6zlm8ysDPpPsoQnfC0sScQM5HOa X-Received: by 2002:a05:620a:1998:b0:785:8a6a:9acc with SMTP id bm24-20020a05620a199800b007858a6a9accmr144524qkb.45.1707154939827; Mon, 05 Feb 2024 09:42:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707154939; cv=pass; d=google.com; s=arc-20160816; b=VLxjv0QKuxoyo+quzCCRhH+i8CJGIO8CTvL3slqEHvcU/+ybNhfbySSsrwGNsbntAY Ph8nW0H3nFP6dH8yl+f5zKotcOocEgQvgw2L5EW5ryU6yONzP7IyCZBD0/zG6mtvXrBi 6J9cKBZyxa3bHN0cAu14IU0VfdtzBT6L+7EuFJ89ThZIw9ZGM+gPMVfQ3x5G0C+F7bTJ 1VA7ZInPaedopgWU73TvPIj070OWAi6A8o/jofjicWgJxxld1EigyzPjWu5Lh94NBTYb ja6n3dJk7setS3PjkEKUXevIADJjqqIDZsPip0JUOYvU5NP4lWG7XnkU2gQRJS5h2n3b 95Iw== 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=wc4GJg7wqUXsCQcFjyikEFMsmQywtLa2eqKw8iFjtKQ=; fh=nUQEH/kj+JUHs6iH6h5ahCOx2Sg2qH9aHLnoiy3671E=; b=wsciOIhouCr24njkQEIsH2O97uXSDR8ekKcoVRI/rGLj+wa17k4NHt7eBt2V6KMP8N h29OUdfFDFQuv2lnZkJdBmcXLzvRNdTcjyJIL/WC2ctEu8sPavchojKnr8nEKPoIHUHR NtjJ9l4rz8spmpy4QIK1PQza4xhvBed8QuZnhP+ra+3cz1Yf3I+hfpx0U2xM11IERNfN DpL1SvrBw6BvFdhXZ+/D9dVZhy3c2D/FQu94IYvL+d0o/uK6YQ1GaOZnhWHLyGq6AfFC IOsaXJN1XvnV/Xtr5bNKFvWKluZPnF6hcQWZzajKXkLLj4B+5IKDlkWIoKUKX2fbzIpo 7D4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ARFN7smw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53134-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU6SPbBSEnA6iKgdZOq2w7Q+Y5NhxTv0xEsEBFK5JRkrojtu68cPx6VaLa+JudhUAEp7AiNC7ZvVZWgsFEwZ96eDUNIAs9tHgy9k79TMw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c4-20020a37e104000000b00783defbe49dsi264514qkm.760.2024.02.05.09.42.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:42:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ARFN7smw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-53134-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53134-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 811091C2271A for ; Mon, 5 Feb 2024 17:42:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5982C44C8D; Mon, 5 Feb 2024 17:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ARFN7smw" 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 8387F446D7 for ; Mon, 5 Feb 2024 17:42:13 +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=1707154933; cv=none; b=ESW8VDzxokmAQ4WS8SVGEkT9I7BatO5zMnhV6BdSnEhlgrDXZaYSVL2CJPytwHAUMGUhzNlm2YvlgEBmGEUMsF9fQ8RcRnhMNYtuLJpOo6nAxpCGF9IZo9h1YcSsDPDTO1BA0VTt3PimPU1zGSRFKh4m3cvRMHkv0v9fyODkIqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707154933; c=relaxed/simple; bh=DzJpzqa6HKjeBMkDi3252zL6zF4x9+HiippWvWe6ZT0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p3N2CAH1w0Dc2HFUM8XGKJDmu0WGsZlnWVzTvJTDh0WVQy9lvMcrhRn9XIJO+tYZqArqs/Wf+7yJ7qlQljT9CZ86UU+kE9ODiaMqxljH68rEOz9zRjgtS3fcwc47qmxTANv4uIh5piEbAIR+/AH7mw3HzpJ/gHvlVmGuq5quEYs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ARFN7smw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BCC8C433F1; Mon, 5 Feb 2024 17:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707154933; bh=DzJpzqa6HKjeBMkDi3252zL6zF4x9+HiippWvWe6ZT0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ARFN7smwTE4fB0CjHhchc3CGJqDVRjeV7WowYO7gJ8Mr7D4N0C+oJWK9zbGqlW9RZ H0liApFKIFynLGIP0unGxVFTPgygJZBLiJgiVyhX79K7XxrbgfZDVCheG/2IY6JNY1 Q6PLPBhwSZopyo5C3nQA5imofe6iIlryOffOfo/M7R7mFR2tlqpYY0XyhTe/csCbLF yuDHke39RfEk9/GyGjt3Z/hpa7wgHEea/Wnd0RsbRSqrOF3iYUuWlX7Rd4MmpLW91I wiA0pTfQLFeVggH0jgGzhUdsZckkGcuCLZ3A+55adHTHIGQDLsBWFnhRXSYmI/LWA0 eJ7WSWjURHnpg== Date: Mon, 5 Feb 2024 17:41:47 +0000 From: Mark Brown To: Dave Martin Cc: Will Deacon , Catalin Marinas , Oleg Nesterov , Al Viro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Anderson Subject: Re: [PATCH] arm64/sve: Lower the maximum allocation for the SVE ptrace regset Message-ID: References: <20240203-arm64-sve-ptrace-regset-size-v1-1-2c3ba1386b9e@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="yAjH7uxAxmBLvyQW" Content-Disposition: inline In-Reply-To: X-Cookie: You might have mail. --yAjH7uxAxmBLvyQW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2024 at 05:11:59PM +0000, Dave Martin wrote: > On Sat, Feb 03, 2024 at 12:16:49PM +0000, Mark Brown wrote: > > We could also teach the ptrace core about runtime discoverable regset s= izes > > but that would be a more invasive change and this is being observed in > > practical systems. > This is not hard at all: see > 27e64b4be4b8 ("regset: Add support for dynamically sized regsets")=20 > But since this is precisely what was ripped out, I guess adding it back > may be controversial (?) Also just that people might want to backport and while it's not super *hard* I tend to prefer to do something as minimal as possible as a fix, the less we do the less the chances that we mess up. > > We should probably also use the actual architectural limit for the > > bitmasks we use in the VL enumeration code, though that's both a little > > bit more involved and less immediately a problem. > Since these masks are 64 bytes each and rarely accessed, it seemed > pointless complexity to make them resizeable... I was suggesting making them use the architectural maximum rather than making them dynamic. > > +#define ARCH_SVE_VQ_MAX 16 > > #define SME_VQ_MAX 16 > Ack, though part of the reason for not doing this was to discourage > people from allocating statically sized buffers in general. I was going to do a patch adding a comment to the header noting that this is not actually the architectural maximum since at present it's a bit of a landmine, people who have some idea of the architecture likely have a rough idea what sort of allocation size is needed for the maximum SVE state and are likely to not double check the value provided (I think that's what happened with the refactoring to remove the dynamic sizing). A comment in the header is still very missable but it'd be something. > If the kernel is now juggling two #defines for the maximum vector size, > this feels like it may seed bitrot... Ideally we'd just not have the existing define externally but it's there and it's been used. --yAjH7uxAxmBLvyQW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmXBHdoACgkQJNaLcl1U h9BE2Qf/S7RezjxPYcWKj6gx3SobiowUdZgpA/cBYjCbutcf3sOYR6Bx6JKXsCK3 OOmL2N8GdxIUtay3VgDpxhvxxeW9yPGuUa5Uqji6/txY9utyBOUB4LIXw4/FCPHc 3hGc1pncwGgM4mKkNQEL/XVxPiiEfRo5WwlNB537Izk1p5+HoOvmX7r07421QKqG oiFPoQXCPCux0hYG4o7wWoWIoXoppg2EZj1+Y7lWJo7xT7OpVwh/Eic2qCtZzdxC O+qb4UzgJFSPzXbfCaHzRdabhnHtxxUO/TIOL/LMDpT8M1wvjDry357u0aDRF92Y mM3RhJrBZ9BffUkjABtEBryY6w7Ltw== =Y4Cv -----END PGP SIGNATURE----- --yAjH7uxAxmBLvyQW--