Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp149863rdh; Wed, 22 Nov 2023 22:59:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmIyXvXmcZaj0SLH1F1RzMNBiRHvn9MGHZCIpob8gos4Z8mBCVTS9JlmqySmH9BbC4MrYc X-Received: by 2002:a05:6a20:1443:b0:187:fbe3:b4d7 with SMTP id a3-20020a056a20144300b00187fbe3b4d7mr5325655pzi.9.1700722770385; Wed, 22 Nov 2023 22:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700722770; cv=none; d=google.com; s=arc-20160816; b=d3PL9bJMLYFOaVB0S9It+qgWI3t5sYFVuN7/q13C1RjxV+mwD1a0RfOux3WJ9LTuNc gAAMIeo3atuXSOdRaiT63opOvyV3PHPX6nbzKriqR6JjUhD6qIIV1DmmAdl4QejLrARi 3zKhwt3aCXqPMinvcl9U6aHCqdxPIqIiCRRu8VunXawdG80dT+wLndHR0P6IraVQaChO /p73xjx3UkDGR0Ji9yzf77xO7VEq7cpWO7zp79tb5ty6VzsIF1bo1qxl+g0gFSv4rveT N07AjFYI5LmCoOtt+kjavsRcSTgVlzsrFvgHV2gPPbS8KTUkStGzZiIbAm+5u62rRin+ jNOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cXVVh5tHQq6H+NSQA4JeCtH/rNgHUAw+NLKBVun1FJI=; fh=lDvMTZMBKweKvOrJ9wQD/BR+dk+xQF4teciUGM79mGM=; b=rz5QGj5Iz0DdPJNX249sXrJYaDa8RnnBvRHoTB+sKv0HRNQfDfSc1YUYKOno0BfYnn JsFvjZqoOJSJa/vtCEZi4ExjwU7anZgRHOtTYibeHVqmr1K0uBhE7f/O4iSPF7nrTbOS sTFAyeNEZfUHnNCtpguGkTsEAhdKeoLd7Bb3vdPGX2MoZoOBgHufmM7PlbxjhuzBadHc B9anXpz3YjNNvI7muhaYZqB0ATlQVrHmXNOSEhxlNdS+F2Zfr1mSkw3SV8pr+jKifzbN AtLQ0l45M5d6gUbySjWe5AKtibde9JV9n9vtOsVWT8EDavITt7iUNBGR2U2kf0Sfk2Vl 4bIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=VGhRI+k+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d3-20020a17090a6f0300b002851546ab95si733706pjk.116.2023.11.22.22.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 22:59:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=VGhRI+k+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C48CB807FD6D; Wed, 22 Nov 2023 22:59:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235351AbjKWG65 (ORCPT + 99 others); Thu, 23 Nov 2023 01:58:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344835AbjKWG6i (ORCPT ); Thu, 23 Nov 2023 01:58:38 -0500 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194CA10F3 for ; Wed, 22 Nov 2023 22:58:26 -0800 (PST) Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6cd1918afb2so354864a34.0 for ; Wed, 22 Nov 2023 22:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1700722706; x=1701327506; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cXVVh5tHQq6H+NSQA4JeCtH/rNgHUAw+NLKBVun1FJI=; b=VGhRI+k+plxBcZ9NjAKo1Pa3AIXjp4IxipMYWF86Cr1uZn/dpu4vysm4ntKJmUrb4f r5QVTvbRzpcSQvr7YjHtGeuh7fqQtzESqpSZrkVM1NAEliMIvNRAQWMLlVzciDPc8Smo 2v9kjpRMQLicJtG3n1vtSoaZCsXN7WFJ9RTbzy8xLc4UYxZ+VqgPzbOSNRPB155/pnpH PotifhDVZIfwQg0l0S+fj8beoF+gnHtjMTxWNKRXU8Gdf1VQXCYnAX5XfeIjZeoMBuGz Db8Kc1KQF4/q19T3HJUFh7qiyC2906RKI32JEef5KN7nr6Rt7N7ENKul79nQ7UWYEA0I +bFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700722706; x=1701327506; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cXVVh5tHQq6H+NSQA4JeCtH/rNgHUAw+NLKBVun1FJI=; b=NixS9RyIa7+uavdw8yTGMunHoZBvYRee722TUJFjP2VSNhu1jZ6a1xFydrqD+mdf6c lL40wbK0wL0ZlvogaF+PIrdZdtf1rdIA2LG5h6DGFx8KfAuzx7gi6QTCHftI/YLavL2q P1/NM1ABoSVhjJae/yCql32d/CYIQFUECtzGZlTXsB6PeovfVnGZrEacL4Zx7h8/yB3c sWFPQTOF8oUaKtgWFSccHiEo/0XShM8FmdDaX1P0Q0SM0aX3TAqDDV6UVFYvGXuaUAgf oVpo7bsGL4Iv5+TwAlu9CEZM4B6wJuEzC5P3CtXbuUWcGQP3evUyLcTk3XRmVksaN3Tc 9xhw== X-Gm-Message-State: AOJu0YybQizTxVtC+2C8GAgpc4el4IdiubDSlO9iQPcX4b24Iu8K5T8/ ExfMwJI0/vZpxCjeLAbr4SLsIg== X-Received: by 2002:a9d:620d:0:b0:6cd:8c3:5b40 with SMTP id g13-20020a9d620d000000b006cd08c35b40mr4649798otj.36.1700722705824; Wed, 22 Nov 2023 22:58:25 -0800 (PST) Received: from J9GPGXL7NT.bytedance.net ([139.177.225.230]) by smtp.gmail.com with ESMTPSA id w37-20020a634765000000b005bd2b3a03eesm615437pgk.6.2023.11.22.22.58.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 22 Nov 2023 22:58:25 -0800 (PST) From: Xu Lu To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, ardb@kernel.org, anup@brainfault.org, atishp@atishpatra.org Cc: dengliang.1214@bytedance.com, xieyongji@bytedance.com, lihangjing@bytedance.com, songmuchun@bytedance.com, punit.agrawal@bytedance.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Xu Lu Subject: [RFC PATCH V1 11/11] riscv: Introduce 64K page size Date: Thu, 23 Nov 2023 14:57:08 +0800 Message-Id: <20231123065708.91345-12-luxu.kernel@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) In-Reply-To: <20231123065708.91345-1-luxu.kernel@bytedance.com> References: <20231123065708.91345-1-luxu.kernel@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 22 Nov 2023 22:59:27 -0800 (PST) This patch introduces new config to control whether enabling the 64K base page feature on RISC-V. Signed-off-by: Xu Lu --- arch/Kconfig | 1 + arch/riscv/Kconfig | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index f4b210ab0612..66f64450d409 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1087,6 +1087,7 @@ config HAVE_ARCH_COMPAT_MMAP_BASES config PAGE_SIZE_LESS_THAN_64KB def_bool y + depends on !RISCV_64K_PAGES depends on !ARM64_64K_PAGES depends on !PAGE_SIZE_64KB depends on !PARISC_PAGE_SIZE_64KB diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 105cbb3ca797..d561f9f7f9b4 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -227,6 +227,7 @@ config RISCV_HW_PAGE_SHIFT config RISCV_PAGE_SHIFT int + default 16 if RISCV_64K_PAGES default 12 config KASAN_SHADOW_OFFSET @@ -692,6 +693,25 @@ config RISCV_BOOT_SPINWAIT If unsure what to do here, say N. +choice + prompt "Page size" + default RISCV_4K_PAGES + help + Page size (translation granule) configuration. + +config RISCV_4K_PAGES + bool "4KB" + help + This feature enables 4KB pages support. + +config RISCV_64K_PAGES + bool "64KB" + depends on ARCH_HAS_STRICT_KERNEL_RWX && 64BIT + help + This feature enables 64KB pages support (4KB by default) + +endchoice + config ARCH_SUPPORTS_KEXEC def_bool MMU -- 2.20.1