Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1367378rbb; Mon, 26 Feb 2024 07:12:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWA0eaQ8ECbym3xkion5l98hCH3IoiP+Mml4oQ+S8f0WGNyZ24RbXm4KpDEM8q6bSlxDUiJP9bQPPyA0NnkZ6fE+VvWUS7q6z1WWUCoTw== X-Google-Smtp-Source: AGHT+IEF0Vpy8wztjDKsXRU+aSFdIUHTpL4peI6EN5+yxOqk/7wQWQuQIrq15XH78YTRaXdlVJhM X-Received: by 2002:a05:6808:3988:b0:3c1:a1e8:aa56 with SMTP id gq8-20020a056808398800b003c1a1e8aa56mr4398408oib.17.1708960339491; Mon, 26 Feb 2024 07:12:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708960339; cv=pass; d=google.com; s=arc-20160816; b=sJCswBMTJ+C4UntPhBl0cJKxLvEGJ/aK/M7Sv7MoITRecVDq/3kgC95qbGxdgp3Wli vVD1F07gRkmZgFabAVWP2Z/uf+kFvyysXeUMtZcqXUby81Oa0Fir8ZZSxFif6sJa0h/T 30QlpSMIWOU84n6amN1pYoBCF4fzQkcl+b3sEcQdGLrzjH9NMDUlvAmEgtU8uUldyHKk esSHSC69PAKF/aOZeCdGrFxNcBvUAZlWtqboqCq6GHwwgTOqi+122EEbC0ycGJW0WaWS swG+4Lz9eY1/kxqKC7FlaOjn/l1OTITiYdk7kJjzMJYOZ5k9+nv77PqXXNOGGRIhwf7K /UJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=LZlaohRiYiN/D4WWlG05hcX9VlBQQ1xGm5D9e36BQLc=; fh=F5v3uTTriChKvJnlrt2iSaozP9pStQMZssqpocm9TpU=; b=Cjqgd+D4F6bVZxniNkNpQdYTxM7Zygo8x/yPUVXss7evmTm0G3g133bAup85rkqhUP MhyMPtiL+1Y2hNoMeEJWpjfnBpvs044qJqNaFWcXMdj4+udtGlDbuAOlqakGyC2QOXJV fhRpGSugMky7bkuCg8CntJVLnkBplVKMQVLBnSsiLdL7vXZdwB1T84vgE9gLQW4r6S6I uQkmlxP7ZfjxNfENgG6UwhfAD3lVdE+50DBjyE84X4gZehigh8GaRrr9cR3xT6pmrxVH RR9woqe874WbrF3gyZ3QEOhXuFl66cL3S1/wdchckDzaOHf9YEtJ2i7mCOlfmF7wSPvb FXSg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PxbLvpIJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 q3-20020a056102204300b0047050effb22si531650vsr.411.2024.02.26.07.12.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81747-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PxbLvpIJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81747-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 37AA31C2B0B7 for ; Mon, 26 Feb 2024 15:12:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17E2F12DDA9; Mon, 26 Feb 2024 14:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PxbLvpIJ" 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 414B42AD16 for ; Mon, 26 Feb 2024 14:57:27 +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=1708959448; cv=none; b=r+xOrQ8jD2u5g9/TkQiXsaUsJwiqaBrSBMjlDjKnZheRj/UBs1BC454ejTyNZxnakitR4LO0Pxj4U957kyf27IIW3o/Dro1Q6G8X4pNW+OT9wuCdRu+Btqy13uk/Q4LqRUr3oKO1PCUQ0L1jxZxQtZ8y5pzZlb8YdWtbwYSXHO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708959448; c=relaxed/simple; bh=sPrQVnmnSPaSkztqFXjNFHxol/WrC9nhR5tw9QxJAlg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SrpgD8cy1gwdwFNKjfuOb0mgizyRHICcTY7XbE4UIk1qVXEGLll3YhYiTXNyg5LxPP7y1W2leMJO+4hffuM7j0RCxDeELG97RZJ1e3dVK8RSDaFWPcUUcd5eB6WG6WwezI3t8G5++hQwvW4iuRDH8om2FAYuZuXfzMBeuTjWGpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PxbLvpIJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8177AC433C7; Mon, 26 Feb 2024 14:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708959447; bh=sPrQVnmnSPaSkztqFXjNFHxol/WrC9nhR5tw9QxJAlg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PxbLvpIJEYlHpdr1A8xYVZRVEbIsK/+s101mjGkyPaiXKiPlcVWfV2SiMgC/jEhP+ pQ06pJ9ltxPT4xzdZVPbL5vPpsXFsMWNNY7WFaQchZgDkrqta2QfSXLaRZ+TMlXRsV wcJseGzQbaBG4yMbJMQ8ctIV42ivMZcMBzyDTYsfYg4qytm99Bfyth0btOZvBHrzf5 NTsW19P3iTQp1Cu+X93N5fQ/whpRMnjv2RYLnoXDfR2z6Y/KXZPcq/x5K/NeMuSKKy ro7+4jgNNjBpkEoEFsSxPksi74HqjL7p/YvTAkn7feRnNRHCW20UNUiGZCC5K0qFqz wP7R/3P8DyLGQ== Message-ID: <07675649-181a-4509-a595-d7ff9230e402@kernel.org> Date: Mon, 26 Feb 2024 06:57:26 -0800 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] riscv: deprecate CONFIG_MMU=n Content-Language: en-US To: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Conor Dooley , Andrew Jones , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra References: <20240226140649.293254-1-cleger@rivosinc.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20240226140649.293254-1-cleger@rivosinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 > > --- > 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) -- Damien Le Moal Western Digital Research