From patchwork Mon Feb 26 14:06:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 13572236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5226C48BF6 for ; Mon, 26 Feb 2024 14:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Kh34stxnCJ8WDZiDLJcJ3M+V4ohxnKX4bN3LR/5GcDM=; b=Ag42rqe90tskPs CH3gZvJRT5AMc5kBOx9l9aRYOUuiSaDkRk9hzBtRD9wE3jOsOA66Thu+ssCuQErWlB6bGx0rwgSTY A4XEIUzYlNOqoMHPHdEE9vW5MPuPEyhVsaLVaW+Ln6SF5SfmwHZWw7unVoAsN75jN5KQ+paECxjGT c3S5LWssiePcRdYS8zpd3US783itofk79rSBuJiPAwP1HYL0Xp0rjLrJOChm2Kvrm1kJefqxpiShX E4/ybFHEO+SYtbd/JkGZgaEtEZgnnZNxlE9soXjuKeoMe7Hj4dmCINEAVPNNlPkQjwwS+QGr9MxCy 8mHPoZKMjSN441sk0+Mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rebeW-000000011cZ-3pr2; Mon, 26 Feb 2024 14:08:21 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rebe8-000000011Sr-2Ou2 for linux-riscv@lists.infradead.org; Mon, 26 Feb 2024 14:08:02 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-412a4e3d079so274705e9.0 for ; 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=lists.infradead.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=VxHJSFBbXMaker6JQNkLv1s28F4ziyK89Ft5N8P2DTcDCkzO/dXx+jIq51oyTB2/Lp aMRADUo28+L7gvpWIZR16spoRNzbp0Red52kq4QbnDqKlRpkLYO+jysLhuxfnxrmRDNR 6gYB5iVu5R7odoeMRmOE2IEcQ89d39yb2sDzNASYxmSB4Gq225WWPzw3EyDIjboJPHg+ uZcEPCrOn/RnwwXjY5c7ty9DoPmuYeJ+lQGpR5WmFDZ0aaCConSqT7Gfe800QWFVdZI9 yYagEs4dYuTDqvqPICE49e3nzOP9B9aYOk7QddUIzdyPHTLYeLXo0mejyHvIu/aMzUDe ySkA== 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=mGkP314ReUQ1xQvoWVOpxbz31CI7JLS9tDFFWnIWaMRqtKzS/N5rf+uf7ke3FLNnRp 8afkC+tlaaNDS063U632fJEnTVG6qCSp98bR1YSTd/kRJDQC/DAyWa1ulaVvmiLSBvyK C4eEKeBQQItdHBpl8rH8iK7+Q7HV5EHSNGdUorbjP9FkQb6VodwVgx2Nz2tFfyeq8Lvs AKSdFCLCT5NHkWiqTlgtIsnPt4NUAcTh1lCHHZwxr0GBUB8tebuFZ3ePeNGTg+K6Nm3f LDp/dWLS5HIuV0/RooQvS4vnTc8XNS1XYKTpys+kqRBM9zXi8onUXpD57ntCF/LTClb4 XcpA== X-Forwarded-Encrypted: i=1; AJvYcCUjAL82Q58Jsn4mlFHgdhpsZ/22xdaOAW8iedLWpxd3eafda4A9leaughuC8O8D8/0udEndRRGwqEeYqMreCqh0Jl1jTnwn2FLdZlIsttZj X-Gm-Message-State: AOJu0YxNOlptwW4h4yeQZWv4yQagFEdvEm0C6dm7A1b9BYzRBYvAHTog fQFOLbtNgeCMZIhx5SvMI9DdejG8KpstoAb1FFK5fJMCOoeJsDLlS5JFx6/hNL0= X-Google-Smtp-Source: AGHT+IFWeLyABthKnQh82+1HfoBCkHmIx/VTkUVLqqzwuzyCNDGWVehu8nc5ISMY2K+88EhoRCllng== 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?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Conor Dooley , Andrew Jones , Damien Le Moal , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Atish Patra 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240226_060758_142132_54D7032B X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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. + 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)