lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40dee2c1-ff24-40b2-a13c-6934139ba869@sifive.com>
Date: Mon, 26 Feb 2024 09:14:38 -0600
From: Samuel Holland <samuel.holland@...ive.com>
To: Clément Léger <cleger@...osinc.com>,
 Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
 <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Conor Dooley <conor.dooley@...rochip.com>,
 Andrew Jones <ajones@...tanamicro.com>, Damien Le Moal <dlemoal@...nel.org>,
 Björn Töpel <bjorn@...osinc.com>,
 Atish Patra <atishp@...osinc.com>
Subject: Re: [PATCH] riscv: deprecate CONFIG_MMU=n

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@...osinc.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)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ