Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1045829rdb; Fri, 2 Feb 2024 11:43:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh5WDjGvohOMebCnU9AZ/j10PCPKKuKn8/5Fz/NSJO+1Z0ES9IAQw/IZf/AAhZIjMm4RtF X-Received: by 2002:a05:6102:31a4:b0:46b:2480:7cd0 with SMTP id d4-20020a05610231a400b0046b24807cd0mr8582475vsh.12.1706902993856; Fri, 02 Feb 2024 11:43:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706902993; cv=pass; d=google.com; s=arc-20160816; b=WedyOlENzKQ8erNoRJflUVFtUjD0ftql4loXmhxTBwxMzQ+9lQ5/IUoMQTZJQyIl04 65hlb0TCKJ2KpRzDqaMrdznONB5C7R8aOexYdqLqcUQZxubNRIK3S+cECzc1G8oYp3lz WRFsvDhUnVKwzI/sIOiIYm7jcFsHD4TpPk7Y4bRKSCCMuOQIXzbkyacKYBzmXGsgpo1R p4iiuFuRH8RoYDxvDMriy6WjXIaDavzAm5HWVwMGohl8Z9McbxydIbw5o78hMGSlsJ3/ I3I1Nx2Ef8GeOBniu5nQeRFUkGjMuKXeanFLdNqohEVXNA5G3+kU9B0/fmD0gfiiUhS+ DzfA== 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=I8CBETRKm6ZXTVdpffhprmzaPKcRtGU5hZf5Edps4+0=; fh=TJ5UQDzy26HPCHOb5zHC/fugK0zLchloIlEqpmozpyQ=; b=bnu/+OJFXx8/9kd7UIY0qBqHplxAgzLgW3N4UMUtAqxKZQ+b4tVfplBjQATeCG3Uo7 hUR7qVNEoGDiO+zPAAz7Z0lGeXgntkyKJ43yrWEVf8POKQHCJ2ggUqq1z6JQ0gHjoScd yhiTj6PzmaBu3+UDQenMaLuKBJ8cJWWmfXqcyoceKfq7mbpyLV/fNifTYUO4YYttvBHe 6hV1GSdc1SGAR0sedI4rkZ0vuUjSiBOpCTgzxIrepEZDlMa2+HhODCSmT7QFlLUXwIyY VMdIJjZn9dFqpdy6LaMFgwau/hUEYWzyEvY06SzVanhAeCoG+mkIvZdHGVxx4kQOVN70 w4YQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="EpDr/jIG"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50491-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50491-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; AJvYcCXm7MigKquJfjKr7RJ7S3xuIYb1Dn6CnYczs5e+Z7PoCaB31e8KEbdApDz/jppNmv1a75LUJMZUcBFt6hSCwqGaD5guvK5UPX0dBJLByg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b9-20020a0cfb49000000b0068c891919bfsi1465678qvq.38.2024.02.02.11.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 11:43:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50491-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="EpDr/jIG"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-50491-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50491-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 9872E1C24529 for ; Fri, 2 Feb 2024 19:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54E528060D; Fri, 2 Feb 2024 19:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EpDr/jIG" 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 7435915E5DA; Fri, 2 Feb 2024 19:43:05 +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=1706902985; cv=none; b=Gh/dGYJL1P6lmWcliMNO1FFwPyfq16yj8QAhfcvCYY2Jh8dsyVN05PynKeYgGee/d66PN5X4RckKMYv86O8FUUPBXH8oZnS2F0CTs7v2mVWHOpDlpQjTssP9CztIn166IPmJ4JNRFlKDnK1qd/AWHBurSsknD8kQHqhY7dhg0Oo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706902985; c=relaxed/simple; bh=ZwrgXHe3wneQypj3Dc4bf/lJKHWeRZdQb8qhTrh4M5A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T4gzg5vNkfb7WV4aOX8JdHwLaNxLXDgDW8YlYE0XiXPbR0WNjF8WHOaJISO13v0sTiImTsahbJcfdKJdxhoJtcD++d2uR5LBgq0zYayhk5uDSt/SuVKm3KFX8Ry0rl/Lo+NXuDRuFVRc3HhVgUCACHakJHfjgPUwshWmBjMd2iY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EpDr/jIG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E23E1C433C7; Fri, 2 Feb 2024 19:43:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706902984; bh=ZwrgXHe3wneQypj3Dc4bf/lJKHWeRZdQb8qhTrh4M5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EpDr/jIGnKGsGpiIqxEkGwO5QRX44YnioBJP5jAu4/eXq5DBe9xAuGNNELCpLD7kq +wJNNAqksWRpk4f46mxTI5MfKKahQM37DWqTG+rUe64NW1E0DnCTmhwdxbXLHulhrh KJfEApVOmLIAihRN1NZsj7M8S2jxmqk+XritSl7sbkFivXBSkgtkbmuiYPAXRaNnfD AUUS3aNnBHaBTjPqxDdF4e+u8vg6QyHrOozmVZUixNfIyOlIfIuItVGod/dQZKzGA2 Kni3bp/3QOsyz6fB7+ZTqfahBC8hAY+Zhtn6zsChSc47sjXTDNra5G49yaijHrVJKq nsqmjGNzMoZTQ== Date: Fri, 2 Feb 2024 19:42:58 +0000 From: Mark Brown To: Dave Martin Cc: Al Viro , Doug Anderson , Christian Brauner , Eric Biederman , Jan Kara , Kees Cook , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oleg Nesterov , Catalin Marinas , Will Deacon , Linux ARM Subject: Re: [PATCH] regset: use vmalloc() for regset_get_alloc() Message-ID: References: <20240202012249.GU2087318@ZenIV> <20240202030438.GV2087318@ZenIV> <20240202034925.GW2087318@ZenIV> <20240202040503.GX2087318@ZenIV> <20240202164947.GC2087318@ZenIV> <20240202165524.GD2087318@ZenIV> 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="5nsJ0jp73mUS/QGW" Content-Disposition: inline In-Reply-To: X-Cookie: Do not write in this space. --5nsJ0jp73mUS/QGW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Feb 02, 2024 at 06:07:54PM +0000, Dave Martin wrote: > So, if the only reason for trying to migrate to vmalloc() is to cope > with an insanely sized regset on arm64, I think somehow or other we can > avoid that. With SME we do routinely see the full glory of the 64K regset for ZA in emulated systems so I think we have to treat it as an issue. > Options: > a) bring back ->get_size() so that we can allocate the correct size > before generating the regset data; > b) make aarch64_regsets[] __ro_after_init and set > aarch64_regsets[REGSET_SVE].n based on the boot-time probed maximum size > (which will be sane); or Either of those seems sensible to me, a function would minimise the size of allocations based on the process configuration which would be nice and given that we're doing allocations it's probably reasonable overhead. > c) allow membufs to grow if needed (sounds fragile though, and may be > hard to justify just for one arch?). I'm having a hard time getting enthusiastic about that one for the reasons you mention. We can also just lower the maximum size we tell the ptrace core to the actual architectural maximum since AFAICT we don't expose that anywhere external, I've got a patch in CI for that. We'd still be allocating more memory than we need for practical systems but less extravagantly so. It seems more suitable for an immediate fix for people to pick up for production. It did occur to me at some point in the past that we should avoid telling the core about regsets that aren't physically supported on the current system, I didn't get round to looking at that yet. --5nsJ0jp73mUS/QGW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmW9RcEACgkQJNaLcl1U h9DOywf/cw76/6sNzpR8nrtANUPfbOuMMe64FuF7iDSV4ZCC0X9SfJ5hHe1GwfQv MzT2r2wocWZbrmhBcxb8YOJoU2uSbI2nc7UdMDMd9PL0UE8RmkEcrIWWFGMClwz4 ++aSfY2e7wiQ9a6X/IrM3jj+lDhx7BY3MGtfkvOqrE88g4yUEU6HS1rjaAzTUW84 WfgsyYRLs7m0SE90x6in8OR5Cdfts2AvqadR6EA4nwpwWOxUsIcw6o/wBpPxd05t gFfYutiSWuHMLlFzxO8VdRBbW69tZRj8xvpnKJ6R2xS1nIzxzZkCNpn88kgLpZP9 ROsCwgB8JM57McXHJCqXOyMxjxfTCA== =Rpx9 -----END PGP SIGNATURE----- --5nsJ0jp73mUS/QGW--