Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp271651rdh; Wed, 7 Feb 2024 04:33:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlLTfcGNlAzcQHLG7T4CR5gxF5hW04Y0Jy3Yj6jixVkf6OVAUqmHwIOtw6TDDPGprRUS/3RrM7FmiX+ehj4VTaqJi2JFOmtUwrd98dRQ== X-Google-Smtp-Source: AGHT+IFJf7d4m5PZDUjHRaKgta5OIhejZ/pZOzTzvyhaGkI5qdQ6O8Nad7PT0RYNOCUJeewVXj9o X-Received: by 2002:a05:6512:404:b0:511:1765:7ed with SMTP id u4-20020a056512040400b00511176507edmr4086312lfk.61.1707309182504; Wed, 07 Feb 2024 04:33:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707309182; cv=pass; d=google.com; s=arc-20160816; b=kF5aB3MiTytpQoiWYMRvkjk59qtSZxidUljg6Trd+NS6df/iGxhytL6Pi9wnB2H2jX UFdqmRhmCNcSCQ9bLvsgUoUwtOHMJVeIC5pJrtII1Xivc+NE5kYAa0RAQcAzg1io/GLK FzZqypN55Zs1ovB4pNqRNguLJyDzDkBwHX3QcBK8Q05tOoa2kSIuFgt94YR8GLzTHEgh 8MTKrjWOetyAmaqzKPZGELxHEIdIyqn6S7mmsQaYQYYSRhvudD6TllhGsBYGbMTnMIw6 fXV73CPfH0vGP/J45N/iwD8Sfzo+SermOp2co2sKr8/fVhglxP2rDgjvZG5ULY9e+Z/9 QyJg== 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=IK75dZS0jvbwYczyIoTpVFXQ/0rVN7KXygB7r7ANtXc=; fh=YGyWLQ2UYoqqujCTqIgu7CPQvqbE6UMlifHLbR8PTeM=; b=DwLT9xLAYfCCep4iwSegbGLKkO8IkrTopAlKXxHga9OiW86OqhfZuPNtqYYZzofamZ PKvEGyM7LASg2Idwg7Dv/acb06AQUUh8//DsBAFtLUMe61uBYclFd5cwQi6zmrbsmQvK CscFX3sNla9lvD0wlpQiIefv6/zKsZSXxMSZhdO7Cipl6KMFsYnioAWGKAAFXKAJBz8g sIY7tkC7Azv48LPIvP0Q+goTeXpH5e6dlfjotRzcu0IGmMsPWi3pVc6iIdoJy0DC8uUs TyGxWo+tlIDGGwBOC0QEs6o90wp0CBRBLFC8t36a66BevHuRRePxwS/KdIr0z52f0lHl 00aw==; 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-56486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56486-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; AJvYcCV2MOEzUamZTqoSusDT60+RmFMk1xw2KM2ahlQ9bert0e7hs1RQb+mTUcE/BipbYuBSRpesuVlzl1J4u2Wxog5mivUzNXo4z8j644kCfw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id mf8-20020a170906cb8800b00a385db689bbsi875097ejb.197.2024.02.07.04.33.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 04:33:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-56486-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56486-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3BF891F24C51 for ; Wed, 7 Feb 2024 12:33:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6DD476041; Wed, 7 Feb 2024 12:32:55 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21FF25A4CC for ; Wed, 7 Feb 2024 12:32:52 +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=1707309175; cv=none; b=fhZhuS3e6DX2cvKWH8q+qVnKQqkPbeyhS8hN5UvB00AvLGzJRWEsmfZ5d04mw5AKPh2poGKF0Xz5nCAo3oB8XlWTBrg2P0LqBUXITOi0CiBzx8JioY9VE9NZfN+adtakNA2YAG7Ea2bqgAwBQnz7/S+FXz0wR0yiPsyRAKVWh8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707309175; c=relaxed/simple; bh=0A2O2AnCQRdpMky+QV6PJ304LgFb3EgxTyizFXYemWM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ONXB9JIfA7lEiEUC6qPk8IYHezMqguKkpzEJ5uxU1wH1ocEKzwFJOARZpXCxZv8ZqOG3C7RRM34ECQl596Ge76dr2w0x/6NNUqQES1lISY5jpTgP+SAYp7xX9CF1RnZbH+NpDbWJvtWKZ/u24xqzQXfgGvW0d3LEEsr/PyI5PdQ= 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 BAC0D1FB; Wed, 7 Feb 2024 04:33:34 -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 4761E3F5A1; Wed, 7 Feb 2024 04:32:51 -0800 (PST) Date: Wed, 7 Feb 2024 12:32:48 +0000 From: Dave Martin To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, Will Deacon , Catalin Marinas , Oleg Nesterov , Al Viro , linux-kernel@vger.kernel.org, Doug Anderson Subject: Re: [RFC PATCH] arm64/sve,sme: Refine scalable regset sizes at boot Message-ID: References: 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 10:04:56AM +0000, Mark Brown wrote: > On Mon, Feb 05, 2024 at 05:27:20PM +0000, Dave Martin wrote: > > > index a5dc6f764195..5c2f91f84c31 100644 > > --- a/arch/arm64/kernel/fpsimd.c > > +++ b/arch/arm64/kernel/fpsimd.c > > @@ -1189,6 +1189,7 @@ void __init sve_setup(void) > > pr_warn("%s: unvirtualisable vector lengths present\n", > > info->name); > > > > + arch_ptrace_sve_init(sve_vq_from_vl(info->max_vl)); > > sve_efi_setup(); > > } > > This will only get run if the system actually supports SVE since the > first thing that sve_setup() does is to exit if the system does not > support SVE. That means that the size limiting will only be done on > systems that have SVE, but since we unconditionally register all our > regsets if the system doesn't have SVE it will end up with a maximally > sized SVE regset registered which doesn't seem ideal. As I mentioned in > the other thread we should probably just not be registering unsupported > regsets with the core, that would avoid the issue without a change to > this patch. > > A similar issue applies for SME. Good point. I guess if we're following this approach we also do have the option to knock out entries of the array altogether once cpufeatures are finalised. If we want a quick fix the silly memory allocation triggering for Douglas' splat then this probably isn't it, but if removing regsets at boot time is desirable anyway, we might kill two birds with one stone here. I'll wait for progress on the other threads before digging too deeply into this (but anyone wanting to see this patch expedited, please shout!) Cheers ---Dave