From: Damien Le Moal <dlemoal@kernel.org>
To: "Clément Léger" <cleger@rivosinc.com>,
"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: "Conor Dooley" <conor.dooley@microchip.com>,
"Andrew Jones" <ajones@ventanamicro.com>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Atish Patra" <atishp@rivosinc.com>
Subject: Re: [PATCH] riscv: deprecate CONFIG_MMU=n
Date: Mon, 26 Feb 2024 07:01:23 -0800 [thread overview]
Message-ID: <595c5b83-79a8-4b68-bf34-32241c83544a@kernel.org> (raw)
In-Reply-To: <90b440e9-65b1-4482-88d4-f06e76863aa6@rivosinc.com>
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)
>>
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2024-02-26 15:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 14:06 [PATCH] riscv: deprecate CONFIG_MMU=n Clément Léger
2024-02-26 14:57 ` Damien Le Moal
2024-02-26 14:59 ` Clément Léger
2024-02-26 15:01 ` Damien Le Moal [this message]
2024-02-26 15:14 ` Samuel Holland
2024-02-26 15:25 ` Clément Léger
2024-02-26 16:02 ` Conor Dooley
2024-02-26 19:00 ` Charles Lohr
2024-02-26 21:29 ` Conor Dooley
2024-02-27 9:11 ` Clément Léger
2024-02-27 16:38 ` Palmer Dabbelt
2024-03-14 12:46 ` Jisheng Zhang
2024-03-14 13:02 ` Jisheng Zhang
2024-03-25 16:59 ` Jisheng Zhang
2024-03-26 20:25 ` Charles Lohr
2024-03-27 1:14 ` Jisheng Zhang
2024-03-27 1:34 ` Charles Lohr
2024-03-27 3:40 ` Jisheng Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=595c5b83-79a8-4b68-bf34-32241c83544a@kernel.org \
--to=dlemoal@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=atishp@rivosinc.com \
--cc=bjorn@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).