Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp496842lqb; Wed, 29 May 2024 01:52:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWCicpj81Lyvpfry7t5b+scFzR1T+IyF5Kv7CC1cdaxfRJlueti5xLfSW6mFbcgu6xyWEfavyURcE0j1mNqSpBOjbpfqRf+IT07lkxMXQ== X-Google-Smtp-Source: AGHT+IHQEY2GyaxAqooiDFzSIitvkAfTjDy9FP1B06c47EI0bW2l66XVlQBottcDM+B65H0PYhZO X-Received: by 2002:a25:2c3:0:b0:dfa:471c:b26 with SMTP id 3f1490d57ef6-dfa471c0d6dmr1489091276.15.1716972723096; Wed, 29 May 2024 01:52:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716972723; cv=pass; d=google.com; s=arc-20160816; b=cofZWbwx4P5/2NK+dvgtAyXCXRPX2eR3yocTnTpLrpN5LB5GDBE46NdBICnEkLta+0 A2YHWu9OvtvCO3IHQqqmSArzu9h1oZJCep6sZY9W6qBOsQ6oQ8LPqPdgKOa4wiOP8g9w zVHEe2AAeW5xtsG/3aqG40nwLNhSg/RejMllK75q4S/SxTR1X3HkbI2YnLfPFyMBDMm0 qqT55LJeDtJawlSszTsxmln6Bqp2SLuEGg+w8Z9I56OJ9Lq0EElowaO8tpEbagNPfR0u UjXM9haCI+Sm4guyVdham6qn0Z0HNLZ+tBjDioN6UE4PjtXYQoVXA3xjYwu1yU+cgrYK 2eSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=2WV26XpcYi/Wf1N6GNGjD5xcp9fL2Z07zgc8Uz0itB4=; fh=lD3BXrZXCn4kWiyOKPyOLh2pEGcMa2GjkrNnY+9GZMw=; b=NIpljSGdz76Ko6WZypeNJMx8DlA0N7a0H+gqzsdPGzNp2b6nHc8AW66rec6+gaZ8PO FzZq9XeINcj6MBe4qwAWD2280L10yN7ZQ4EzIPSp8h+Nf6l7691oaBx7oQlclcmtqHTB FQKy4k2dbfmhb2jCPItUyulzJIR5jkaOFxUE/nxTxT+Qx9q9/fhnVAjOYjykiVpJNOGU qfs6dVOfweUk0cUJv3ZlUtWAz5FxsnqiD6g4k9hYFbsFL93AqWbABpRYdGHMSesIXDiD +ceWuiw7KPPlv8AemshXa9d1n+lb+u/BGO1IHNkPzwltCG/K2MRKT05XcC04cPl9r0qs GL8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-193794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193794-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac162afd80si120380966d6.462.2024.05.29.01.52.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 01:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-193794-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193794-linux.lists.archive=gmail.com@vger.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 C0E5E1C234D9 for ; Wed, 29 May 2024 08:52:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7063F176FD6; Wed, 29 May 2024 08:47:53 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 769F0175545 for ; Wed, 29 May 2024 08:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716972472; cv=none; b=Wtrek0Y6KLcGmvjNAIBDNrAmu91xHw1myLCrUPljnQs+nRBbOQY/zJgwNmtX3tXSE/dp1h4/y/IT+ZsnCaB2Fg1QREW5OX2NunaPIzQl+etQ0LIrFcdIiu9XpqdyCrGbj0vttHvJuV8aopXKU6/GzPNvp9UhOfbI3XV7bX0KuE4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716972472; c=relaxed/simple; bh=QPLz+5EPc7RiBkWK7FqfnbKNVxm6qHft5JAgAcNdaFo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LiZZ4xWcot6xFF1ReoKySxLFAJpXXXhWwaih+DipP//3jqCDO0r/WGpcR9RpyV+lVcbIYDiZnlppaqJUXQiYJIMJCMpSuoDF8wwAH8R2i9eKBi67mRD/eahxoQgHK3+AuKmBaMWrs9lrDcmbmdCEAhHOQuhAvoMAQ6no03X+moQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id 847A5E000A; Wed, 29 May 2024 08:47:41 +0000 (UTC) Message-ID: Date: Wed, 29 May 2024 10:47:40 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] RISC-V: clarify what some RISCV_ISA* config options do Content-Language: en-US To: Conor Dooley , linux-riscv@lists.infradead.org Cc: Conor Dooley , xiao.w.wang@intel.com, Andrew Jones , pulehui@huawei.com, Charlie Jenkins , Paul Walmsley , Palmer Dabbelt , linux-kernel@vger.kernel.org, Samuel Holland , Pu Lehui , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= References: <20240528-applaud-violin-facef8d9d846@spud> <20240528-varnish-status-9c22973093a0@spud> From: Alexandre Ghiti In-Reply-To: <20240528-varnish-status-9c22973093a0@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr Hi Conor, On 28/05/2024 13:11, Conor Dooley wrote: > From: Conor Dooley > > During some discussion on IRC yesterday and on Pu's bpf patch [1] > I noticed that these RISCV_ISA* Kconfig options are not really clear > about their implications. Many of these options have no impact on what > userspace is allowed to do, for example an application can use Zbb > regardless of whether or not the kernel does. Change the help text to > try and clarify whether or not an option affects just the kernel, or > also userspace. None of these options actually control whether or not an > extension is detected dynamically as that's done regardless of Kconfig > options, so drop any text that implies the option is required for > dynamic detection, rewording them as "do x when y is detected". > > Link: https://lore.kernel.org/linux-riscv/20240328-ferocity-repose-c554f75a676c@spud/ [1] > Reviewed-by: Andrew Jones > Signed-off-by: Conor Dooley > --- > arch/riscv/Kconfig | 36 +++++++++++++++++++----------------- > 1 file changed, 19 insertions(+), 17 deletions(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index b94176e25be1..3b702e6cc051 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -501,7 +501,8 @@ config RISCV_ISA_C > help > Adds "C" to the ISA subsets that the toolchain is allowed to emit > when building Linux, which results in compressed instructions in the > - Linux binary. > + Linux binary. This option produces a kernel that will not run on > + systems that do not support compressed instructions. > > If you don't know what to do here, say Y. > > @@ -511,8 +512,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 in the kernel when it > + is detected at boot. To me, the new version makes things even more confusing: svnapot mappings will indeed be handled by the kernel (since only the kernel sets up the page tables) but it will only be used (for now) for HugeTLB mappings in userspace. > > The Svnapot extension is used to mark contiguous PTEs as a range > of contiguous virtual-to-physical translations for a naturally > @@ -530,9 +531,8 @@ config RISCV_ISA_SVPBMT > depends on RISCV_ALTERNATIVE > default y > help > - Adds support to dynamically detect the presence of the Svpbmt > - ISA-extension (Supervisor-mode: page-based memory types) and > - enable its usage. > + Add support for the Svpbmt ISA-extension (Supervisor-mode: > + page-based memory types) in the kernel when it is detected at boot. > > The memory type for a page contains a combination of attributes > that indicate the cacheability, idempotency, and ordering > @@ -551,14 +551,15 @@ config TOOLCHAIN_HAS_V > depends on AS_HAS_OPTION_ARCH > > config RISCV_ISA_V > - bool "VECTOR extension support" > + bool "Vector extension support" > depends on TOOLCHAIN_HAS_V > depends on FPU > select DYNAMIC_SIGFRAME > default y > help > - Say N here if you want to disable all vector related procedure > - in the kernel. > + 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 procedures. > > If you don't know what to do here, say Y. > > @@ -616,8 +617,8 @@ config RISCV_ISA_ZBB > depends on RISCV_ALTERNATIVE > default y > help > - Adds support to dynamically detect the presence of the ZBB > - extension (basic bit manipulation) and enable its usage. > + Add support for enabling optimisations in the kernel when the > + Zbb extension is detected at boot. > > The Zbb extension provides instructions to accelerate a number > of bit-specific operations (count bit population, sign extending, > @@ -633,9 +634,9 @@ config RISCV_ISA_ZICBOM > select RISCV_DMA_NONCOHERENT > select DMA_DIRECT_REMAP > help > - Adds support to dynamically detect the presence of the ZICBOM > - extension (Cache Block Management Operations) and enable its > - usage. > + Add support for the Zicbom extension (Cache Block Management > + Operations) and enable its use in the kernel when it is detected > + at boot. > > The Zicbom extension can be used to handle for example > non-coherent DMA support on devices that need it. > @@ -648,7 +649,7 @@ config RISCV_ISA_ZICBOZ > default y > help > Enable the use of the Zicboz extension (cbo.zero instruction) > - when available. > + in the kernel when it is detected at boot. > > The Zicboz extension is used for faster zeroing of memory. > > @@ -693,8 +694,9 @@ config FPU > bool "FPU support" > default y > help > - Say N here if you want to disable all floating-point related procedure > - in the kernel. > + Add support for floating point operations when an FPU is detected at > + boot. When this option is disabled, neither the kernel nor userspace > + may use the floating point unit. > > If you don't know what to do here, say Y. >