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: 206671 Return-Path: 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 (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 ; 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 ; 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 ; 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?= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791971307042973682 X-GMAIL-MSGID: 1791971307042973682 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)