linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: guoren@kernel.org
To: guoren@kernel.org, arnd@arndb.de
Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org,
	linux-arch@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>
Subject: [PATCH 08/13] csky: Use top-down mmap layout
Date: Sat,  1 Aug 2020 01:14:08 +0000	[thread overview]
Message-ID: <1596244453-98575-9-git-send-email-guoren@kernel.org> (raw)
In-Reply-To: <1596244453-98575-1-git-send-email-guoren@kernel.org>

From: Guo Ren <guoren@linux.alibaba.com>

Follow riscv mmap layout with commit "riscv: make mmap allocation
top-down by default (54c95a11cc1b)".

Before:
 cat /proc/self/maps
00008000-000dc000 r-xp 00000000 fe:00 17         /bin/busybox
000dc000-000dd000 r--p 000d3000 fe:00 17         /bin/busybox
000dd000-000de000 rw-p 000d4000 fe:00 17         /bin/busybox
2aaa8000-2aac6000 r-xp 00000000 fe:00 196        /lib/ld-2.28.9000.so
2aac6000-2aac7000 r-xp 00000000 00:00 0          [vdso]
2aac7000-2aac8000 r--p 0001e000 fe:00 196        /lib/ld-2.28.9000.so
2aac8000-2aac9000 rw-p 0001f000 fe:00 196        /lib/ld-2.28.9000.so
2aac9000-2aad9000 r-xp 00000000 fe:00 219        /lib/libresolv-2.28.9000.so
2aad9000-2aada000 r--p 0000f000 fe:00 219        /lib/libresolv-2.28.9000.so
2aada000-2aadb000 rw-p 00010000 fe:00 219        /lib/libresolv-2.28.9000.so
2aadb000-2aadd000 rw-p 00000000 00:00 0
2aadd000-2ac27000 r-xp 00000000 fe:00 203        /lib/libc-2.28.9000.so
2ac27000-2ac28000 ---p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
2ac28000-2ac2a000 r--p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
2ac2a000-2ac2b000 rw-p 0014c000 fe:00 203        /lib/libc-2.28.9000.so
2ac2b000-2ac2e000 rw-p 00000000 00:00 0
7fb99000-7fbba000 rwxp 00000000 00:00 0          [stack]

After:
 cat /proc/self/maps
00008000-000dc000 r-xp 00000000 fe:00 17         /bin/busybox
000dc000-000dd000 r--p 000d3000 fe:00 17         /bin/busybox
000dd000-000de000 rw-p 000d4000 fe:00 17         /bin/busybox
77e13000-77f5d000 r-xp 00000000 fe:00 203        /lib/libc-2.28.9000.so
77f5d000-77f5e000 ---p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
77f5e000-77f60000 r--p 0014a000 fe:00 203        /lib/libc-2.28.9000.so
77f60000-77f61000 rw-p 0014c000 fe:00 203        /lib/libc-2.28.9000.so
77f61000-77f66000 rw-p 00000000 00:00 0
77f66000-77f76000 r-xp 00000000 fe:00 219        /lib/libresolv-2.28.9000.so
77f76000-77f77000 r--p 0000f000 fe:00 219        /lib/libresolv-2.28.9000.so
77f77000-77f78000 rw-p 00010000 fe:00 219        /lib/libresolv-2.28.9000.so
77f78000-77f96000 r-xp 00000000 fe:00 196        /lib/ld-2.28.9000.so
77f96000-77f97000 r-xp 00000000 00:00 0          [vdso]
77f97000-77f98000 r--p 0001e000 fe:00 196        /lib/ld-2.28.9000.so
77f98000-77f99000 rw-p 0001f000 fe:00 196        /lib/ld-2.28.9000.so
7fd7b000-7fd9c000 rwxp 00000000 00:00 0          [stack]

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/csky/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
index c51f64c..fd92d73 100644
--- a/arch/csky/Kconfig
+++ b/arch/csky/Kconfig
@@ -9,6 +9,7 @@ config CSKY
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_QUEUED_RWLOCKS if NR_CPUS>2
 	select ARCH_WANT_FRAME_POINTERS if !CPU_CK610
+	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
 	select COMMON_CLK
 	select CLKSRC_MMIO
 	select CSKY_MPINTC if CPU_CK860
@@ -38,6 +39,7 @@ config CSKY
 	select GX6605S_TIMER if CPU_CK610
 	select HAVE_ARCH_TRACEHOOK
 	select HAVE_ARCH_AUDITSYSCALL
+	select HAVE_ARCH_MMAP_RND_BITS
 	select HAVE_ARCH_SECCOMP_FILTER
 	select HAVE_COPY_THREAD_TLS
 	select HAVE_DEBUG_BUGVERBOSE
@@ -151,6 +153,14 @@ config L1_CACHE_SHIFT
 	default "5"	if (CPU_CK807 || CPU_CK810)
 	default "6"	if (CPU_CK860)
 
+config ARCH_MMAP_RND_BITS_MIN
+	default 8
+
+# max bits determined by the following formula:
+#  VA_BITS - PAGE_SHIFT - 3
+config ARCH_MMAP_RND_BITS_MAX
+	default 17
+
 menu "Processor type and features"
 
 choice
-- 
2.7.4

  parent reply	other threads:[~2020-08-01  1:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01  1:14 [PATCH 00/13] Update csky subsystem for linux-5.9-rc1 guoren
2020-08-01  1:14 ` [PATCH 01/13] csky: remove unusued thread_saved_pc and *_segments functions/macros guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 02/13] csky: Add SECCOMP_FILTER supported guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 03/13] csky: Add cpu feature register hint for smp guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 04/13] csky: Fixup duplicated restore sp in RESTORE_REGS_FTRACE guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 05/13] csky: Fixup kprobes handler couldn't change pc guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 06/13] csky: Add support for function error injection guoren
2020-08-01  1:14 ` [PATCH 07/13] csky: Optimize the trap processing flow guoren
2020-08-01  1:14 ` guoren [this message]
2020-08-01  1:14 ` [PATCH 09/13] csky: Set CONFIG_NR_CPU 4 as default guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 10/13] csky: Fixup warning by EXPORT_SYMBOL(kmap) guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 11/13] csky: Add irq_work support guoren
2020-08-01  1:14 ` [PATCH 12/13] csky: Add arch_show_interrupts for IPI interrupts guoren
2020-08-01  1:14   ` guoren
2020-08-01  1:14 ` [PATCH 13/13] csky: Add context tracking support guoren
2020-08-01  1:14   ` guoren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1596244453-98575-9-git-send-email-guoren@kernel.org \
    --to=guoren@kernel.org \
    --cc=arnd@arndb.de \
    --cc=guoren@linux.alibaba.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).