Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp321203rdh; Wed, 7 Feb 2024 05:59:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEk1MO+seKp1S29ZbcjgPl7LhVUvrfSJYyBHgyjjHk2eYfKIxza6U/rJ99EHv10OpqDVMmm X-Received: by 2002:a17:902:d486:b0:1d9:c37d:7194 with SMTP id c6-20020a170902d48600b001d9c37d7194mr5472344plg.30.1707314394608; Wed, 07 Feb 2024 05:59:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707314394; cv=pass; d=google.com; s=arc-20160816; b=xS67E8YoxJf3tN4rWGbJ9H8BtKzs/yNDOhrWSGIgiOdwyqLMJSkx3Bapt6BEABwZ7h /bhWfjlJZpEVreH148VIgn4p2BmM/t5krloli86YpFPtanW9WHh4NOwsVuhNG47Xpfc7 F1Js65ZElzbUMw7CWv3b0mdSG/PYq0ieQYxgvN4hdVaGgfD+DbG98Kl377WB//bCeApn 4+cbu14UuTop7NOMQY7vpuCX0oBsBwieJM0SMCnsVwUUss48E5YimbitpWsUus5a4t0w gD3TXrbmI7oVqyrp7yK0Byd95EEEjsGcdPP7ErVinlN2IHOWWiKAdTwzyKQTxeK8VCrD 2Y+w== 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; bh=5Po2yWG/XQgoutay4sGfqMuAD2wD4rTVJKZnEwF/ALw=; fh=IwNM8wGmGJ77BcaIV85y+ry4apGoDMpYVlg3t2++zqU=; b=BsOlWZ/hk6RqdMq3l86H8LnssoY9bQ0SO0osMdPyQTy4XNBeJBCOWKilitH+4zUams ihQkd8+g3O7uRe9lwEMWIFni0jamlpw9fvh8Anv+edffed4VwlXRKbV2YApTYX+cAdC6 htH9YHr9hhSqQwlfimcsFVWapAIxnqHT/V5Yvkwwkzkk96NVHYgBOnjPOPcPbZdQX2Vg Nkwhi8SvSTX3VgpzN212i4lR8OF4KydR1zPvCwMh8b9VY4+BjF+Fl7srzmdElQwGV8ZZ +ozbD80Ihqd/lwOK/dCw6tR+NbnoDCBpz7Xhkk5yl9kMiLjVc03xZMOuHxSKdI1XLtDo DIiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-56584-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCUHv/B5vte32on6/QiD0NwwrNPaggXLm8YxZ3ZPMTtzijtU7yjTriSjRcu0+AlLHCTeGgMb8jMEM+cijYbYrva54itrml7CPcz2dJBG7A== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n3-20020a170903110300b001d8a6c3aa7bsi1673152plh.316.2024.02.07.05.59.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 05:59:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56584-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-56584-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B70D5290C66 for ; Wed, 7 Feb 2024 13:51:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2C9B7A702; Wed, 7 Feb 2024 13:51:50 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9366077F08 for ; Wed, 7 Feb 2024 13:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313910; cv=none; b=cyDtay/NvBiz0t6nt3rIWQjaZAKutuWK7b+59i4uPmMkBiIePOV6W+IDKLIhJ6J3V1wnhyU31PUp8feLC3oCmU1xl8OiCMnx1yvSBKBR+dpAL25vSxsHG0FvVjk81oTrNV+Jn2mI3ZSOXij+bTXWOzEz1SMGyn8rateDNNLqbNo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707313910; c=relaxed/simple; bh=zexCmC4fXcwE3lcy44wNcZYTwGpTTivyKi8epTwOIFs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FXbqwaklr3sFVhbSQUUbIHXeYnnwsbUl3ARVOun5zSVd/yz7DFvLJoEg6v7A4BsSOqJTJBeOU8UBl9aNYURtBbV9ghjDPGi9sqczvrymc+I7dAchHuPxuBy1rq7ai+FP+4jIJfi64UaLlBfaYAq1ePHnGaY+sLLqyQKk2A7c9ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C8C891FB; Wed, 7 Feb 2024 05:52:28 -0800 (PST) Received: from e133380.arm.com (e133380.arm.com [10.1.197.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 543D53F5A1; Wed, 7 Feb 2024 05:51:45 -0800 (PST) Date: Wed, 7 Feb 2024 13:51:42 +0000 From: Dave Martin To: Mark Brown 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Feb 07, 2024 at 01:09:51PM +0000, Mark Brown wrote: > On Wed, Feb 07, 2024 at 12:23:56PM +0000, Dave Martin wrote: > > On Mon, Feb 05, 2024 at 05:41:47PM +0000, Mark Brown wrote: > > > On Mon, Feb 05, 2024 at 05:11:59PM +0000, Dave Martin wrote: > > > > > 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. > > > To clarify, is this intended as a temporary band-aid against silly > > behaviour while a cleaner solution is found, or a permanent limitation? > > Ideally we'd just make everything dynamic, other than the regset issue > and the bitmasks used for VL enumeration we're there already. Making > the bitmasks dynamically sized is more painful but are also doing > enumeration that userspace doesn't need to do. For the bitmasks, we'd be saving (512 - 16) / 8 = 62 bytes for each of SVE and SME (I think). The tradeoff really didn't seem worth it... > > > We'd need to change various things if the architectural max VL actually > > grew, so no forward-portability is lost immediately if the kernel > > adopts 16 internally, but I'm still a little concerned that people may > > poke about in the kernel code as a reference and this will muddy the > > waters regarding how to do the right thing in userspace (I know people > > shouldn't, but...) > > I think if we fix the ptrace regset issue we're doing a good enough job > of just using fully dynamic sizing with no limits other than what's been > enumerated there. We could possibly deal with the enumberation code by > changing it to use ZCR/SMCR_ELx_LEN_ based defines so that it's > obviously coming from what we can possibly write to the register but > it's a bit less clear how to do that neatly. OK, but we still seem to have two competing approaches: clamp SVE_VQ_MAX for kernel internal purposes, or restore the dynamic sizing of NT_ARM_SVE based on the new regset core behaviour. Are you saying we should or both, or otherwise which one? Cheers ---Dave