Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp713286lqt; Fri, 19 Apr 2024 08:17:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjThiQJ5Hcn37BJVxJMdkz9SHDjBam8RnY18WqC6aH/viS4aKCa9hieGQd4aQb2lxIPm4R5Sh13PoazeEOcnaNQBR6CxCjE7US8gRHzA== X-Google-Smtp-Source: AGHT+IGxVmKT2ETUvtTLNEiYsviQAyJKMQH0dbVYogZ6aQ3m4ZivuIQioktd9aOjhjdER8cwp0pX X-Received: by 2002:a05:6a20:72a2:b0:1a9:11e5:2915 with SMTP id o34-20020a056a2072a200b001a911e52915mr3884638pzk.27.1713539849651; Fri, 19 Apr 2024 08:17:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713539849; cv=pass; d=google.com; s=arc-20160816; b=dbuP65f2PdG/xrElMBkLGe4csgPG4DqiHnKh6yiejJLtN0hLB7kt49vMBODhPcUiDM L8f0Z9ypLoKxLgCg4LWWtMS7g7PTe6PyhSQf74depVya0YopZ/GgdwnNA+x3Tk7aHins d/HZZC/XgLOSY2ZzvmtwJKWwbRgQ9Q136I+xwmnESVaXjmPcNLW0lO1doA8Cfz9sNeEN 6YizRgS8d2j13lZBW3PYxpTihSPElGPxIh/qN+9qjVj+PMQcto+C57zXwDMxWzC3k3Kz ZQeK88eB0PvwAq1BRJSiZSNvFF/ozdcHwSmlrCHpxB32pKb79wEy18L1rfcWwgq3okhd 0EcQ== 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=nMOnkHSzLXWySXKeQzz7blwHFTbWuiy2eNKUcUTK8Mw=; fh=0p9p45BnBLh0tOs45GRM7zEl3LzX3gUZ5EnCSJBGzv4=; b=s/H9eaNJP8fYg4HPrwBSj/AtxybNvaemLepf+xk3N2HegEB7prhVBmfXpGr/qpcRqz 1MrSzQuz+L0sj9l/uHTh7XnIFkLlq1r4nGJ6fubBZh71pOl/4XD9Iz6Kd7lxLjBHd1C8 zUJCx8dkV3b+O1/7ENr1g70OzciAaPPSHd4Y6HhQVouyebZbJbBxvrllf8oc+3sA/s/j b19GiuoakEFSQLB+DqtHcAjiqN8OXPQUoHIT/OaAkNaLxJvyqY1/7BN767TZbLH06kVV oaUo0q/KYUj/Mf/6NExKQmy4mWESmPLm001A+fICvj06w6Q9DOZXM5bod0Bgx+kSxFDf iwvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gnw9arBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151647-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ln8-20020a056a003cc800b006f0bf99e500si1682492pfb.274.2024.04.19.08.17.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gnw9arBD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151647-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151647-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DC257B22651 for ; Fri, 19 Apr 2024 15:17:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0BB112F592; Fri, 19 Apr 2024 15:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gnw9arBD" 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 E1F7112F376 for ; Fri, 19 Apr 2024 15:17:20 +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=1713539841; cv=none; b=TQ1Jtg/qXEHSgtsdrTpynzp3B5c4S4DKIyka8whiTWp9AL57r+IfOhIP2AjAfB0B3h7tq6DsiE8RDw0FQg0FxuQ3EQmzbQxLlsjhCRCYCaWAO5j8qreM/hMWqFV5g013aHQYwEYKT+aSBxxxLzw6JMA+gxblRVWpHJG0shIESvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713539841; c=relaxed/simple; bh=SnnWaQWmaH4Y1VcI2/IotnKQLBlBuYV8WwApJhdtqlg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=au8qLNaCs+uFr0e3KK+4gYHJLg/lC3vPlX1xwWiKRYqo3RP/FMVpK9wT3n8UraZFQlxWVZSZTCAR07l0xDsq0qrgM3pKRyWZjtLJzEL3Qp1R/YWvjbgdul5+9vLIV30abcSpXM3QFYzzOGxcsln9xMLAMbMW99Xd7n9tYa9+hiw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gnw9arBD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62C9AC072AA; Fri, 19 Apr 2024 15:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713539840; bh=SnnWaQWmaH4Y1VcI2/IotnKQLBlBuYV8WwApJhdtqlg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Gnw9arBDC1Ax9q3qDwIFKZPM7ohNDDCmNKcEpQhpKM9noHzBL7xpGSlnA9IvzjkCu b1GhvfQUEzuCO3tg/BHf4/nTJJHa1fNuUlwQHYNKbHwXqpN6YRztnuKt/A8gGItRGt WP+kABU8cjBW3PujW3pfRqt66K4ML2tSW4bnXIkhnBQbsl1AI5by2qnTXa85cPYq+G iKCHgYZBtqr+UjEJSfOoX0qxAkIwDC1klRDewFBoU2PVngUIIxJC/rTp5A88rz9KXA VrWmuCDeqhuwtEl+hmbiaqy/4gHmEnUJp7cC/gJilF1cp/RWKSDUlsz/SOPKiI7Vea RqJwdHIIaLuLg== Date: Fri, 19 Apr 2024 16:17:10 +0100 From: Conor Dooley To: Andrew Jones Cc: linux-riscv@lists.infradead.org, Conor Dooley , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Samuel Holland , Pu Lehui , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Paul Walmsley , Palmer Dabbelt , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] RISC-V: clarify what some RISCV_ISA* config options do Message-ID: <20240419-recount-blip-29e45e4d4cec@spud> References: <20240418-stable-railway-7cce07e1e440@spud> <20240419-ea2b867f6bde90e711464c95@orel> <20240419-excretory-dwarf-ba817cc725ea@spud> <20240419-b5dbe7b133a749afdc0af416@orel> 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-sha256; protocol="application/pgp-signature"; boundary="FX/POwus9dap633f" Content-Disposition: inline In-Reply-To: <20240419-b5dbe7b133a749afdc0af416@orel> --FX/POwus9dap633f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 19, 2024 at 04:05:34PM +0200, Andrew Jones wrote: > On Fri, Apr 19, 2024 at 12:06:59PM +0100, Conor Dooley wrote: > > On Fri, Apr 19, 2024 at 01:01:52PM +0200, Andrew Jones wrote: > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > > > index 6d64888134ba..c3a7793b0a7c 100644 > > > > --- a/arch/riscv/Kconfig > > > > +++ b/arch/riscv/Kconfig > > > > @@ -503,8 +503,8 @@ config RISCV_ISA_SVNAPOT > > > > depends on RISCV_ALTERNATIVE > > > > default y > > > > help > > > > - Allow kernel to detect the Svnapot ISA-extension dynamically at= boot > > > > - time and enable its usage. > > > > + Add support for the Svnapot ISA-extension when it is detected by > > > > + the kernel at boot. > > >=20 > > > I'm not sure we need the 'by the kernel', since I guess that's implie= d by > > > being in a Kconfig help text, but either way is fine by me. > >=20 > > I think we do, given some of the options are required for userspace to > > use it and others are not. Distinguishing between them doesn't cos us > > more than a few characters so I think it is worthwhile. >=20 > I agree we should ensure 'support in the kernel' type of text is present, > but here we're saying 'detected by the kernel' which I was thinking was > implied since this is kernel code. Maybe we should just add the 'the > kernel' text to where the support is rather than where the detection is? Sure, that makes sense to me. We could go for "Say y here to add support for the Foobar ISA extension for foobarisation in the kernel when it is detected at boot" and in the cases where userspace depends on the option too we could additionally say "When this option is disabled, neither the kernel nor userspace may use Foobar". So Svnapot could become Say y here to add support for the Svnapot (Naturally Aligned Power of Two Pages) ISA extension in the kernel when it is detected at boot. The Svnapot extension is used to mark contiguous PTEs as a range of contiguous virtual-to-physical translations for a naturally aligned power-of-2 (NAPOT) granularity larger than the base 4KB page size. When HUGETLBFS is also selected this option unconditionally allocates some memory for each NAPOT page size supported by the kernel. When optimizing for low memory consumption and for platforms without the Svnapot extension, it may be better to say N here. And vector would be Say y here to add support for the Vector extension when it is detected at boot. When this option is disabled, neither the kernel nor userspace may use vector. If you don't know what to do here, say Y. The other thing is the "Say y here" stuff. I find it to be a little weird to be honest - these are all default enable I don't think "Say y" makes sense, but writing inverted descriptions feels wrong. Maybe the solution is just s/Say y here to a/A/, which many of these extensions already do? > I assumed it was left off of the 'Add support' because Svnapot is for > S-mode. So part of my rationale for being over-eager in re-wording is that I know people just copy-paste these config options and it's easy to miss. >=20 > >=20 > >=20 > > > > @@ -686,7 +687,8 @@ config FPU > > > > default y > > > > help > > > > Say N here if you want to disable all floating-point related pr= ocedure > > > > - in the kernel. > > > > + in the kernel. Without this option enabled, neither the kernel = nor > > > > + userspace may use floating-point procedures. > > > > =20 > > > > If you don't know what to do here, say Y. > > > > > > >=20 > > > Zicboz could also use some clarification, right? Or is the fact that > > > RISCV_ISA_ZICBOZ enables the use in both the kernel and userspace the > > > reason "Enable the use of the Zicboz extension (cbo.zero instruction) > > > when available." looks sufficient? Maybe Zicboz should follow the > > > "Say N here if..." pattern of V and FPU? > >=20 > > Yeah, I think I just overlooked Zicboz. If the kernel option is needed > > for userspace to use it then yeah, it should follow the same wording as > > V/FPU. >=20 > Actually, never mind. I was thinking we only set the envcfg when this > config was selected, but that's not true. We'll set it whenever the > extension is present with or without this config. So I guess it can > follow Zicbom's pattern. I'm regretting trying to change these options sorta minimially - Zicbom's Add support for the Zicbom extension (Cache Block Management Operations) and enable its use in the kernel when it is detected at boot. is better worded than the Svnapot one purely cos of what it looked like before the patch. I think for v2 I'll re-write them all to look pretty similar in terms of their opening paragraph. --FX/POwus9dap633f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZiKK9gAKCRB4tDGHoIJi 0pKdAQCtBkg+TOzWadLEO2l5cjF4wenvVWIAKOTb3pKMsegkGAD9GPIjBrjSwOG8 cmbH1NA9NhtkHkirOf+tGRwod+W+yw0= =Izji -----END PGP SIGNATURE----- --FX/POwus9dap633f--