Message ID | 20240226140649.293254-1-cleger@rivosinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-81589-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2104630dyb; Mon, 26 Feb 2024 06:16:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVL3C6jGbldsoUoqURv1+oZ/+X0+esml7oDk0RwGJLf3ZBg+1mhAatLhHzkBvmOWH7VO8iPrvBfYVWzEvfhA5t6IMWypQ== X-Google-Smtp-Source: AGHT+IEA76arcW2u9xVJIdL4U+HCzqnkqANVDDOSNniPBZVfNKsgufIZnAYdQwjNaLfuSbptEZQ7 X-Received: by 2002:a17:903:496:b0:1dc:3ab7:cc78 with SMTP id jj22-20020a170903049600b001dc3ab7cc78mr6075067plb.29.1708957011070; Mon, 26 Feb 2024 06:16:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708957011; cv=pass; d=google.com; s=arc-20160816; b=LBHb/8a4W8oK0AN3D3eu9sW+l+yHuo5EG+Oa2Fn/3mMOzhW4NyKpjAMXZ7/x/T4WF/ yKiXtoY6H+3pE+b0VYfTdA9jyLUYuT842hFLSLqdZy+V3jykv99Y05NC0Y/pNz3afcdY jXFQpoEXu6OfrT0zLYLeiyfFmeuUC06tmtrpnFPkBWNaOHK22feW/+WyKSaz22ZB+vod tknsMTAmC4nD5WyWPKvf+Dn1NN84SWMXQ0fUUXcy/F/AYd5XuVEH5u4jLlZ1sDlbic41 14TyiOcE5oUpv9gadcXBJclK97eRgm/78e9r0PLr1leJUQVVH6MmMTPmxsF5icPr2DeV dSJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=z3cft7Ypg0legv2IgemzKJux6J8rPPIzvMpQQPbvnK0=; fh=f0HovYzKxJvuBTTkCUVn4D64XOQoV52d5WJaWTIzP2Y=; b=yX9YfnteN+3e23dTZo7/zHp600PHgPa9CSZtpPouPWhaDLp5nQDnFVBNTc4z3hAV5m +leacmpVKr5eVxRpoL9e//mU3y14OkTDFuWq7fyNxUmbaWY1SU/IxTbIaktX/iS79tWj EPUDMrxLMNWXSGKCLqNLF/URFOs1Xy+KmV87Bzu/JTTDP45hz+laKPHKloBGnaSyrdbL 7yRPmVhlotHt6I4FSsq4gLGbIPbxtUlTp7j6Ff1ov7MceL81XnraoeU0UCrIUwnHGJUH AqQBq5cI0EgtoURca9d2dJEggw+g5fVMw8YhuRXrVAaX/UP0vA/a+Mla3a8WqgSfl6/u CMnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ba7gGwNi; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-81589-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81589-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b17-20020a170902e95100b001dc819f1591si3714188pll.463.2024.02.26.06.16.50 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 06:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81589-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=ba7gGwNi; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-81589-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81589-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 749E729005D for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 14:12:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDAFB12F581; Mon, 26 Feb 2024 14:07:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="ba7gGwNi" Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF0B312A163 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 14:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708956476; cv=none; b=Wg22WpDEQQODjJYi8runFBFliBx1QhWu/lg747ZJ+x4DCVmo/Uj7PXc5SiTvdDhOcC6Nmmq6EW+4ec9iIbHkY5oNk+uIQtXWGTQdhS7nh0G+dhQcLDwD68L4XgXeSuw/IGhmPLnAabcjqr47fTXQh9FmTabnYJZC5gtRfmWcfaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708956476; c=relaxed/simple; bh=nweeBOvRgRi9dgBd4ttPVYmzQlmi56/EZ7L4CdCmq5Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BLY1wsp8H+NRVn4GvNnqw3TvgK8rqKZHHmXgFce4jYv63ryPnAkB+b0m55ilmfaoQXc5vTTGkx6VAG5Augnl6ixTMsLeOS98fDAgwf+vUZN1x7l5JMgacUnh+nYbNoPkwgr790Ysi327HgN5WJp/U0GbsyX3Q392ZCotHq8zBns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=ba7gGwNi; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-41288100ecaso2024835e9.1 for <linux-kernel@vger.kernel.org>; Mon, 26 Feb 2024 06:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1708956473; x=1709561273; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=z3cft7Ypg0legv2IgemzKJux6J8rPPIzvMpQQPbvnK0=; b=ba7gGwNiKehdqNn2xV00BT7UtUukS8aX/MAK56gKLACsP6j/W3AtkWbFlvNJV5+vUC qDvBOBugbs+XPoIvFHAuAx4c0JCSy3Fzui579YhXIwG/IMKy5HDlxRO3rKh4SB3xByXR 6r8iEIhNnruf5s79bei9l0+b9LssV7UMGIChiR4DAxnzdbD7J1RPYJEJ0Sta+Xfvs3Vh ugv4ilMteSYOWFvP1tTyooDogqiWryDw5w7qY1CYu2636WPWzeXgbm8e3xv1/QaeEVCs XzEwK9S4wqPLYZXzdPu5FU7TjoGNxoAlmWGFTQUpYJmjtPtY7yNzBRSjDHqI4+KmeIz+ eetA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708956473; x=1709561273; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z3cft7Ypg0legv2IgemzKJux6J8rPPIzvMpQQPbvnK0=; b=d4Lf8nSICgP1D4tEiK9Z0TymxZVDK7w8MwXohuz4ofcre4Oa19ovAvU4g4BQcWKgc7 TGUpzLxlvL+pvTV6QHG2NX+0OJ50EZyAm7ROp/2nFZ7C1R/9JELzAqOA7bAfx6Yt2EZ1 YEGT2zxXv+mZYWc2QUxw/Qybx88RX3BIqcIW2loPPWuxDKYBz5ArPYorwuKn5KZymoZk MgbqLIiW1rwVjGMqEXGyt+j1ifoRm4sN667M9u61zTjAUy+0SU87aZ2mf1TC7axzlbwV /0ltl9r6VDx724muL1nrZ21SmxIbzS3WpNlWejvyAJECaB6Ruvs1vDNZYFy/t9/Qm2kZ jzDA== X-Forwarded-Encrypted: i=1; AJvYcCXxy9f4arUlVqVmNxv0oxovXZiIwW8hsYlYzyH5080bFrVTYzoD2qhIRchhaeKiEe2CYEVXb53b0W7WR0Y0sPNZ7E2HWpOtkumX0Dtl X-Gm-Message-State: AOJu0YwmidT1AS+Gu36UddX3j5r73bcyzd8NYt0k0cQ8mNuX/zh8t8Tn vO+nxkZxja4kuqepoqKr9iRZBt/SKp/N31ug0aOuQEvIPz5AYdqEbtwC+Y+pekY= X-Received: by 2002:a05:600c:3ba6:b0:412:2b7a:6816 with SMTP id n38-20020a05600c3ba600b004122b7a6816mr5168803wms.0.1708956472906; Mon, 26 Feb 2024 06:07:52 -0800 (PST) Received: from carbon-x1.. ([2a01:e0a:999:a3a0:83a3:2c00:c690:18b0]) by smtp.gmail.com with ESMTPSA id h19-20020a05600c261300b00412a30cd127sm4802196wma.7.2024.02.26.06.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 06:07:52 -0800 (PST) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com> To: Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <cleger@rivosinc.com>, Conor Dooley <conor.dooley@microchip.com>, Andrew Jones <ajones@ventanamicro.com>, Damien Le Moal <dlemoal@kernel.org>, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= <bjorn@rivosinc.com>, Atish Patra <atishp@rivosinc.com> Subject: [PATCH] riscv: deprecate CONFIG_MMU=n Date: Mon, 26 Feb 2024 15:06:46 +0100 Message-ID: <20240226140649.293254-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791971307042973682 X-GMAIL-MSGID: 1791971307042973682 |
Series |
riscv: deprecate CONFIG_MMU=n
|
|
Commit Message
Clément Léger
Feb. 26, 2024, 2:06 p.m. UTC
Deprecation of NOMMU support for riscv was discussed during LPC 2023
[1]. Reasons for this involves lack of users as well as maintenance
efforts to support this mode. psABI FDPIC specification also never
made it upstream and last public messages of this development seems to
date back from 2020 [2]. Plan the deprecation to be done in 2 years from
now. Mark the Kconfig option as deprecated by adding a new dummy option
which explicitly displays the deprecation in case of CONFIG_MMU=n. This option
is selected indirectly by CONFIG_RISCV_M_MODE since an option can not
select another one directly with a "select" in case of such CONFIG=n.
Additionally, display a pr_err() message at boot time in case of NOMMU
build to warn about upcoming deprecation.
Link: https://lpc.events/event/17/contributions/1478/ [1]
Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2]
Signed-off-by: Clément Léger <cleger@rivosinc.com>
---
arch/riscv/Kconfig | 8 ++++++++
arch/riscv/kernel/setup.c | 4 ++++
2 files changed, 12 insertions(+)
Comments
On 2024/02/26 6:06, Clément Léger wrote: > Deprecation of NOMMU support for riscv was discussed during LPC 2023 > [1]. Reasons for this involves lack of users as well as maintenance > efforts to support this mode. psABI FDPIC specification also never > made it upstream and last public messages of this development seems to > date back from 2020 [2]. Plan the deprecation to be done in 2 years from > now. Mark the Kconfig option as deprecated by adding a new dummy option > which explicitly displays the deprecation in case of CONFIG_MMU=n. This option > is selected indirectly by CONFIG_RISCV_M_MODE since an option can not > select another one directly with a "select" in case of such CONFIG=n. > Additionally, display a pr_err() message at boot time in case of NOMMU > build to warn about upcoming deprecation. > > Link: https://lpc.events/event/17/contributions/1478/ [1] > Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2] > Signed-off-by: Clément Léger <cleger@rivosinc.com> > > --- > arch/riscv/Kconfig | 8 ++++++++ > arch/riscv/kernel/setup.c | 4 ++++ > 2 files changed, 12 insertions(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index bffbd869a068..8da58c102d3f 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX > # set if we run in machine mode, cleared if we run in supervisor mode > config RISCV_M_MODE > bool > + select NOMMU > default !MMU > > # set if we are running in S-mode and can use SBI calls > @@ -236,6 +237,13 @@ config MMU > Select if you want MMU-based virtualised addressing space > support by paged memory management. If unsure, say 'Y'. > > +config NOMMU > + depends on !MMU > + bool "NOMMU kernel (DEPRECATED)" > + help > + NOMMU kernel is deprecated and is scheduled for removal by > + the beginning of 2027. 2 years from now is 2026... > + > config PAGE_OFFSET > hex > default 0xC0000000 if 32BIT && MMU > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c > index 4f73c0ae44b2..8799816ef0a6 100644 > --- a/arch/riscv/kernel/setup.c > +++ b/arch/riscv/kernel/setup.c > @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) > riscv_set_dma_cache_alignment(); > > riscv_user_isa_enable(); > + > +#if !defined(CONFIG_MMU) if (!IS_ENABLED(CONFIG_MMU)) would be more elegant here... > + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); Why pr_err() ? pr_warn() seems more appropriate. > +#endif > } > > bool arch_cpu_is_hotpluggable(int cpu)
On 26/02/2024 15:57, Damien Le Moal wrote: > On 2024/02/26 6:06, Clément Léger wrote: >> Deprecation of NOMMU support for riscv was discussed during LPC 2023 >> [1]. Reasons for this involves lack of users as well as maintenance >> efforts to support this mode. psABI FDPIC specification also never >> made it upstream and last public messages of this development seems to >> date back from 2020 [2]. Plan the deprecation to be done in 2 years from >> now. Mark the Kconfig option as deprecated by adding a new dummy option >> which explicitly displays the deprecation in case of CONFIG_MMU=n. This option >> is selected indirectly by CONFIG_RISCV_M_MODE since an option can not >> select another one directly with a "select" in case of such CONFIG=n. >> Additionally, display a pr_err() message at boot time in case of NOMMU >> build to warn about upcoming deprecation. >> >> Link: https://lpc.events/event/17/contributions/1478/ [1] >> Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2] >> Signed-off-by: Clément Léger <cleger@rivosinc.com> >> >> --- >> arch/riscv/Kconfig | 8 ++++++++ >> arch/riscv/kernel/setup.c | 4 ++++ >> 2 files changed, 12 insertions(+) >> >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index bffbd869a068..8da58c102d3f 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX >> # set if we run in machine mode, cleared if we run in supervisor mode >> config RISCV_M_MODE >> bool >> + select NOMMU >> default !MMU >> >> # set if we are running in S-mode and can use SBI calls >> @@ -236,6 +237,13 @@ config MMU >> Select if you want MMU-based virtualised addressing space >> support by paged memory management. If unsure, say 'Y'. >> >> +config NOMMU >> + depends on !MMU >> + bool "NOMMU kernel (DEPRECATED)" >> + help >> + NOMMU kernel is deprecated and is scheduled for removal by >> + the beginning of 2027. > > 2 years from now is 2026... Guess I'm a bit tired -_-' > >> + >> config PAGE_OFFSET >> hex >> default 0xC0000000 if 32BIT && MMU >> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c >> index 4f73c0ae44b2..8799816ef0a6 100644 >> --- a/arch/riscv/kernel/setup.c >> +++ b/arch/riscv/kernel/setup.c >> @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) >> riscv_set_dma_cache_alignment(); >> >> riscv_user_isa_enable(); >> + >> +#if !defined(CONFIG_MMU) > > if (!IS_ENABLED(CONFIG_MMU)) > > would be more elegant here... Sure. > >> + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); > > Why pr_err() ? pr_warn() seems more appropriate. Agreed. Thanks, Clément > >> +#endif >> } >> >> bool arch_cpu_is_hotpluggable(int cpu) >
On 2024/02/26 6:59, Clément Léger wrote: > > > On 26/02/2024 15:57, Damien Le Moal wrote: >> On 2024/02/26 6:06, Clément Léger wrote: >>> Deprecation of NOMMU support for riscv was discussed during LPC 2023 >>> [1]. Reasons for this involves lack of users as well as maintenance >>> efforts to support this mode. psABI FDPIC specification also never >>> made it upstream and last public messages of this development seems to >>> date back from 2020 [2]. Plan the deprecation to be done in 2 years from >>> now. Mark the Kconfig option as deprecated by adding a new dummy option >>> which explicitly displays the deprecation in case of CONFIG_MMU=n. This option >>> is selected indirectly by CONFIG_RISCV_M_MODE since an option can not >>> select another one directly with a "select" in case of such CONFIG=n. >>> Additionally, display a pr_err() message at boot time in case of NOMMU >>> build to warn about upcoming deprecation. >>> >>> Link: https://lpc.events/event/17/contributions/1478/ [1] >>> Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2] >>> Signed-off-by: Clément Léger <cleger@rivosinc.com> >>> >>> --- >>> arch/riscv/Kconfig | 8 ++++++++ >>> arch/riscv/kernel/setup.c | 4 ++++ >>> 2 files changed, 12 insertions(+) >>> >>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >>> index bffbd869a068..8da58c102d3f 100644 >>> --- a/arch/riscv/Kconfig >>> +++ b/arch/riscv/Kconfig >>> @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX >>> # set if we run in machine mode, cleared if we run in supervisor mode >>> config RISCV_M_MODE >>> bool >>> + select NOMMU >>> default !MMU >>> >>> # set if we are running in S-mode and can use SBI calls >>> @@ -236,6 +237,13 @@ config MMU >>> Select if you want MMU-based virtualised addressing space >>> support by paged memory management. If unsure, say 'Y'. >>> >>> +config NOMMU >>> + depends on !MMU >>> + bool "NOMMU kernel (DEPRECATED)" >>> + help >>> + NOMMU kernel is deprecated and is scheduled for removal by >>> + the beginning of 2027. >> >> 2 years from now is 2026... > > Guess I'm a bit tired -_-' Off-by-1 bug. It happens :) > >> >>> + >>> config PAGE_OFFSET >>> hex >>> default 0xC0000000 if 32BIT && MMU >>> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c >>> index 4f73c0ae44b2..8799816ef0a6 100644 >>> --- a/arch/riscv/kernel/setup.c >>> +++ b/arch/riscv/kernel/setup.c >>> @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) >>> riscv_set_dma_cache_alignment(); >>> >>> riscv_user_isa_enable(); >>> + >>> +#if !defined(CONFIG_MMU) >> >> if (!IS_ENABLED(CONFIG_MMU)) >> >> would be more elegant here... > > Sure. > >> >>> + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); >> >> Why pr_err() ? pr_warn() seems more appropriate. > > Agreed. > > Thanks, > > Clément > >> >>> +#endif >>> } >>> >>> bool arch_cpu_is_hotpluggable(int cpu) >>
On 2024-02-26 8:06 AM, Clément Léger wrote: > Deprecation of NOMMU support for riscv was discussed during LPC 2023 > [1]. Reasons for this involves lack of users as well as maintenance > efforts to support this mode. psABI FDPIC specification also never > made it upstream and last public messages of this development seems to > date back from 2020 [2]. Plan the deprecation to be done in 2 years from What are the criteria for delaying/canceling the removal? NOMMU support doesn't rot nearly as fast as XIP; static PIE ELF works and is well specified; and as mentioned at LPC, there are some users, even if "just for fun". > now. Mark the Kconfig option as deprecated by adding a new dummy option > which explicitly displays the deprecation in case of CONFIG_MMU=n. This option > is selected indirectly by CONFIG_RISCV_M_MODE since an option can not > select another one directly with a "select" in case of such CONFIG=n. > Additionally, display a pr_err() message at boot time in case of NOMMU > build to warn about upcoming deprecation. > > Link: https://lpc.events/event/17/contributions/1478/ [1] > Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2] > Signed-off-by: Clément Léger <cleger@rivosinc.com> > > --- > arch/riscv/Kconfig | 8 ++++++++ > arch/riscv/kernel/setup.c | 4 ++++ > 2 files changed, 12 insertions(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index bffbd869a068..8da58c102d3f 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX > # set if we run in machine mode, cleared if we run in supervisor mode > config RISCV_M_MODE > bool > + select NOMMU > default !MMU > > # set if we are running in S-mode and can use SBI calls > @@ -236,6 +237,13 @@ config MMU > Select if you want MMU-based virtualised addressing space > support by paged memory management. If unsure, say 'Y'. > > +config NOMMU > + depends on !MMU > + bool "NOMMU kernel (DEPRECATED)" > + help > + NOMMU kernel is deprecated and is scheduled for removal by > + the beginning of 2027. > + The idiomatic way to display this kind of warning is a comment directive: diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index d4e890fb5b5a..b736440ce0f7 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -248,6 +248,9 @@ config MMU Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. +comment "NOMMU support is deprecated (scheduled for removal in 2027)" + depends on !MMU + config PAGE_OFFSET hex default 0xC0000000 if 32BIT && MMU Regards, Samuel > config PAGE_OFFSET > hex > default 0xC0000000 if 32BIT && MMU > diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c > index 4f73c0ae44b2..8799816ef0a6 100644 > --- a/arch/riscv/kernel/setup.c > +++ b/arch/riscv/kernel/setup.c > @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) > riscv_set_dma_cache_alignment(); > > riscv_user_isa_enable(); > + > +#if !defined(CONFIG_MMU) > + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); > +#endif > } > > bool arch_cpu_is_hotpluggable(int cpu)
On 26/02/2024 16:14, Samuel Holland wrote: > On 2024-02-26 8:06 AM, Clément Léger wrote: >> Deprecation of NOMMU support for riscv was discussed during LPC 2023 >> [1]. Reasons for this involves lack of users as well as maintenance >> efforts to support this mode. psABI FDPIC specification also never >> made it upstream and last public messages of this development seems to >> date back from 2020 [2]. Plan the deprecation to be done in 2 years from > > What are the criteria for delaying/canceling the removal? NOMMU support doesn't > rot nearly as fast as XIP; static PIE ELF works and is well specified; and as > mentioned at LPC, there are some users, even if "just for fun". Hi Samuel, I was actually developing some feature that encountered NOMMU build failures and I was reminded that NOMMU was discussed to be deprecated during last LPC. I guess I could also mark XIP as deprecated. The rationale behind delaying is to let some users to manifest themselves before a full removal. But this can still be discussed of course, this patch was also meant to trigger such feedback. > >> now. Mark the Kconfig option as deprecated by adding a new dummy option >> which explicitly displays the deprecation in case of CONFIG_MMU=n. This option >> is selected indirectly by CONFIG_RISCV_M_MODE since an option can not >> select another one directly with a "select" in case of such CONFIG=n. >> Additionally, display a pr_err() message at boot time in case of NOMMU >> build to warn about upcoming deprecation. >> >> Link: https://lpc.events/event/17/contributions/1478/ [1] >> Link: https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/ZjYUJswknQ4/m/WYRRylTwAAAJ [2] >> Signed-off-by: Clément Léger <cleger@rivosinc.com> >> >> --- >> arch/riscv/Kconfig | 8 ++++++++ >> arch/riscv/kernel/setup.c | 4 ++++ >> 2 files changed, 12 insertions(+) >> >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index bffbd869a068..8da58c102d3f 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX >> # set if we run in machine mode, cleared if we run in supervisor mode >> config RISCV_M_MODE >> bool >> + select NOMMU >> default !MMU >> >> # set if we are running in S-mode and can use SBI calls >> @@ -236,6 +237,13 @@ config MMU >> Select if you want MMU-based virtualised addressing space >> support by paged memory management. If unsure, say 'Y'. >> >> +config NOMMU >> + depends on !MMU >> + bool "NOMMU kernel (DEPRECATED)" >> + help >> + NOMMU kernel is deprecated and is scheduled for removal by >> + the beginning of 2027. >> + > > The idiomatic way to display this kind of warning is a comment directive: > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index d4e890fb5b5a..b736440ce0f7 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -248,6 +248,9 @@ config MMU > Select if you want MMU-based virtualised addressing space > support by paged memory management. If unsure, say 'Y'. > > +comment "NOMMU support is deprecated (scheduled for removal in 2027)" > + depends on !MMU > + Thanks, I was not able to find any example of such usage. Clément > config PAGE_OFFSET > hex > default 0xC0000000 if 32BIT && MMU > > Regards, > Samuel > >> config PAGE_OFFSET >> hex >> default 0xC0000000 if 32BIT && MMU >> diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c >> index 4f73c0ae44b2..8799816ef0a6 100644 >> --- a/arch/riscv/kernel/setup.c >> +++ b/arch/riscv/kernel/setup.c >> @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) >> riscv_set_dma_cache_alignment(); >> >> riscv_user_isa_enable(); >> + >> +#if !defined(CONFIG_MMU) >> + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); >> +#endif >> } >> >> bool arch_cpu_is_hotpluggable(int cpu) >
On Mon, Feb 26, 2024 at 04:25:24PM +0100, Clément Léger wrote:
> I guess I could also mark XIP as deprecated.
I'm not so sure, people recently added XIP support to QEMU (and sent
kernel fixes in December). XIP is also not nearly as much of a problem
to support, there's far less that it does differently, the main barrier
was the inability to test it which is no longer the case.
That said, XIP is gonna kill itself off I feel as it does not support
runtime patching and therefore is extremely limited on extensions, given
we use alternatives for all of that (although I suppose if someone has a
usecase they could make nasty macros worse and implement a compiletime
switch in the alternatives too).
Cheers,
Conor.
WOAH! Please DO NOT deprecate NOMMU. I use the NOMMU build constantly and NOMMU Linux on RISC-V is the avenue used by many FPGA soft cores for Linux, as well as some limited systems. I get new copies of the kernel when there are releases and test them frequently to make sure everything is still working as expected. For us we just don't care about XIP. I mean if someone did push it through to fruition, I'd also test and use it, but I urge you please do not deprecate this. While it's sometimes needed a bit of a creative build to get everything working, I've never needed to patch anything in the kernel beyond patching in a custom console for serial output. I am happy to discuss the possibility of me and or one of the other RISC-V soft (FPGA) core people stepping up to try to be more active, but so far we've just been very well serviced by the current NOMMU Linux setup. Charles On Mon, Feb 26, 2024 at 8:03 AM Conor Dooley <conor@kernel.org> wrote: > > On Mon, Feb 26, 2024 at 04:25:24PM +0100, Clément Léger wrote: > > I guess I could also mark XIP as deprecated. > > I'm not so sure, people recently added XIP support to QEMU (and sent > kernel fixes in December). XIP is also not nearly as much of a problem > to support, there's far less that it does differently, the main barrier > was the inability to test it which is no longer the case. > That said, XIP is gonna kill itself off I feel as it does not support > runtime patching and therefore is extremely limited on extensions, given > we use alternatives for all of that (although I suppose if someone has a > usecase they could make nasty macros worse and implement a compiletime > switch in the alternatives too). > > Cheers, > Conor. > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
On Mon, Feb 26, 2024 at 11:00:41AM -0800, Charles Lohr wrote: > WOAH! Please DO NOT deprecate NOMMU. I use the NOMMU build constantly > and NOMMU Linux on RISC-V is the avenue used by many FPGA soft cores > for Linux, as well as some limited systems. > > I get new copies of the kernel when there are releases and test them > frequently to make sure everything is still working as expected. That is great - it is good to know that people are actively testing. I was aware that a lot of the soft core folks did run nommu kernels (and I know some do use XIP also) but everything I ever saw was running on old kernels (5.x). > On Mon, Feb 26, 2024 at 8:03 AM Conor Dooley <conor@kernel.org> wrote: > > > > On Mon, Feb 26, 2024 at 04:25:24PM +0100, Clément Léger wrote: > > > I guess I could also mark XIP as deprecated. > > > > I'm not so sure, people recently added XIP support to QEMU (and sent > > kernel fixes in December). XIP is also not nearly as much of a problem > > to support, there's far less that it does differently, the main barrier > > was the inability to test it which is no longer the case. > > That said, XIP is gonna kill itself off I feel as it does not support > > runtime patching and therefore is extremely limited on extensions, given > > we use alternatives for all of that (although I suppose if someone has a > > usecase they could make nasty macros worse and implement a compiletime > > switch in the alternatives too). > For us we just don't care about XIP. I mean if someone did push it > through to fruition, I'd also test and use it, but I urge you please > do not deprecate this. XIP does work. What I was talking about here was supporting something "fancier" than rv{32,64}imafdc. > While it's sometimes needed a bit of a > creative build to get everything working, I've never needed to patch > anything in the kernel beyond patching in a custom console for serial > output. > > I am happy to discuss the possibility of me and or one of the other > RISC-V soft (FPGA) core people stepping up to try to be more active, > but so far we've just been very well serviced by the current NOMMU > Linux setup. Most of the issues aren't with nommu actually working, it is the extra effort in development as it has to be accounted for. I would estimate that 2/3 of the build issues I report on this list are nommu. The best thing that you can do to ensure support for things you use is: a) scream when someone wants to remove it b) actively let people know you're using it Seems like you're doing a) but maybe getting someone that provides Tested-bys whenever you test the releases would be good. Cheers, Conor.
On 26/02/2024 20:00, Charles Lohr wrote: > WOAH! Please DO NOT deprecate NOMMU. I use the NOMMU build constantly > and NOMMU Linux on RISC-V is the avenue used by many FPGA soft cores > for Linux, as well as some limited systems. > > I get new copies of the kernel when there are releases and test them > frequently to make sure everything is still working as expected. > > For us we just don't care about XIP. I mean if someone did push it > through to fruition, I'd also test and use it, but I urge you please > do not deprecate this. While it's sometimes needed a bit of a > creative build to get everything working, I've never needed to patch > anything in the kernel beyond patching in a custom console for serial > output. > Hey Charles, No worries, we actually did not expected NOMMU to have *so many* users. I guess deprecating stuff is a good way to have immediate feedback ;). Having FDPIC psABI to be merged upstream could also probably be a positive point toward a better NOMMU support. > I am happy to discuss the possibility of me and or one of the other > RISC-V soft (FPGA) core people stepping up to try to be more active, > but so far we've just been very well serviced by the current NOMMU > Linux setup. It could probably be nice to have some feedback/Tested-by: from NOMMU users for new releases then. Thanks, Clément > > Charles > > > On Mon, Feb 26, 2024 at 8:03 AM Conor Dooley <conor@kernel.org> wrote: >> >> On Mon, Feb 26, 2024 at 04:25:24PM +0100, Clément Léger wrote: >>> I guess I could also mark XIP as deprecated. >> >> I'm not so sure, people recently added XIP support to QEMU (and sent >> kernel fixes in December). XIP is also not nearly as much of a problem >> to support, there's far less that it does differently, the main barrier >> was the inability to test it which is no longer the case. >> That said, XIP is gonna kill itself off I feel as it does not support >> runtime patching and therefore is extremely limited on extensions, given >> we use alternatives for all of that (although I suppose if someone has a >> usecase they could make nasty macros worse and implement a compiletime >> switch in the alternatives too). >> >> Cheers, >> Conor. >> >> _______________________________________________ >> linux-riscv mailing list >> linux-riscv@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-riscv
On Tue, 27 Feb 2024 01:11:41 PST (-0800), cleger@rivosinc.com wrote: > > > On 26/02/2024 20:00, Charles Lohr wrote: >> WOAH! Please DO NOT deprecate NOMMU. I use the NOMMU build constantly >> and NOMMU Linux on RISC-V is the avenue used by many FPGA soft cores >> for Linux, as well as some limited systems. OK. I just build test this stuff, as I don't really have a use for it personally. I figured if nobody's reporting bugs then probably it's broken and nobody's noticed because nobody's using it. >> I get new copies of the kernel when there are releases and test them >> frequently to make sure everything is still working as expected. I'd actually expected it to be broken, but I guess we managed to avoid screwing things up ;) >> For us we just don't care about XIP. I mean if someone did push it >> through to fruition, I'd also test and use it, but I urge you please >> do not deprecate this. While it's sometimes needed a bit of a >> creative build to get everything working, I've never needed to patch >> anything in the kernel beyond patching in a custom console for serial >> output. >> > > Hey Charles, > > No worries, we actually did not expected NOMMU to have *so many* users. > I guess deprecating stuff is a good way to have immediate feedback ;). > Having FDPIC psABI to be merged upstream could also probably be a > positive point toward a better NOMMU support. Ya, that's probably the right way to do it. Touching anything in the psABI is pretty miserable, though, so I don't really want to force people to do it... >> I am happy to discuss the possibility of me and or one of the other >> RISC-V soft (FPGA) core people stepping up to try to be more active, >> but so far we've just been very well serviced by the current NOMMU >> Linux setup. > > It could probably be nice to have some feedback/Tested-by: from NOMMU > users for new releases then. Having more upstream interaction from users is always appreciated, that's the best way to prove people are using the code. If you guys have the time it'd be great to get this into some sort of CI, ideally running on some real platform. > Thanks, > > Clément > >> >> Charles >> >> >> On Mon, Feb 26, 2024 at 8:03 AM Conor Dooley <conor@kernel.org> wrote: >>> >>> On Mon, Feb 26, 2024 at 04:25:24PM +0100, Clément Léger wrote: >>>> I guess I could also mark XIP as deprecated. >>> >>> I'm not so sure, people recently added XIP support to QEMU (and sent >>> kernel fixes in December). XIP is also not nearly as much of a problem >>> to support, there's far less that it does differently, the main barrier >>> was the inability to test it which is no longer the case. >>> That said, XIP is gonna kill itself off I feel as it does not support >>> runtime patching and therefore is extremely limited on extensions, given >>> we use alternatives for all of that (although I suppose if someone has a >>> usecase they could make nasty macros worse and implement a compiletime >>> switch in the alternatives too). >>> >>> Cheers, >>> Conor. >>> >>> _______________________________________________ >>> linux-riscv mailing list >>> linux-riscv@lists.infradead.org >>> http://lists.infradead.org/mailman/listinfo/linux-riscv
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index bffbd869a068..8da58c102d3f 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -221,6 +221,7 @@ config ARCH_MMAP_RND_COMPAT_BITS_MAX # set if we run in machine mode, cleared if we run in supervisor mode config RISCV_M_MODE bool + select NOMMU default !MMU # set if we are running in S-mode and can use SBI calls @@ -236,6 +237,13 @@ config MMU Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. +config NOMMU + depends on !MMU + bool "NOMMU kernel (DEPRECATED)" + help + NOMMU kernel is deprecated and is scheduled for removal by + the beginning of 2027. + config PAGE_OFFSET hex default 0xC0000000 if 32BIT && MMU diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 4f73c0ae44b2..8799816ef0a6 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -295,6 +295,10 @@ void __init setup_arch(char **cmdline_p) riscv_set_dma_cache_alignment(); riscv_user_isa_enable(); + +#if !defined(CONFIG_MMU) + pr_err("RISC-V NOMMU support is deprecated and scheduled for removal by the beginning of 2027\n"); +#endif } bool arch_cpu_is_hotpluggable(int cpu)