lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230104130000.69806-1-wangkefeng.wang@huawei.com>
Date:   Wed, 4 Jan 2023 21:00:00 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: [PATCH] arm64: make ARCH_FORCE_MAX_ORDER selectable

The other architectures with ARCH_FORCE_MAX_ORDER are selectable,
but not for ARM64, this is to make it selectable on ARM64, which
is useful for user that need to allocate more than 4MB of physically
contiguous memory with 4K pagesize, also more bigger on 16K pagesize
too, the max value of MAX_ORDER is calculated bellow,

see include/linux/mmzone.h,

  MAX_ORDER - 1 + PAGE_SHIFT <= SECTION_SIZE_BITS

  so max value of MAX_ORDER = SECTION_SIZE_BITS + 1 - PAGE_SHIFT

    | SECTION_SIZE_BITS |  PAGE_SHIFT  |  max MAX_ORDER  |  default MAX_ORDER |
----+-------------------+--------------+-----------------+--------------------+
4K  |       27          |      12      |     16          |      11            |
16K |       27          |      14      |     14          |      12            |
64K |       29          |      16      |     14          |      14            |
----+-------------------+--------------+-----------------+--------------------+

Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
 arch/arm64/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 03934808b2ed..22f0fb73a762 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1457,9 +1457,11 @@ config XEN
 	  Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
 
 config ARCH_FORCE_MAX_ORDER
-	int
+	int "Maximum zone order" if ARM64_4K_PAGES || ARM64_16K_PAGES
 	default "14" if ARM64_64K_PAGES
+	range 12 14 if ARM64_16K_PAGES
 	default "12" if ARM64_16K_PAGES
+	range 11 16 if ARM64_4K_PAGES
 	default "11"
 	help
 	  The kernel memory allocator divides physically contiguous memory
-- 
2.35.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ