From: Sami Tolvanen <samitolvanen@google.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>
Cc: linux-mm@kvack.org, linux-riscv@lists.infradead.org,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH 1/2] mm: Change mmap_rnd_bits_max to __ro_after_init
Date: Fri, 29 Sep 2023 21:11:57 +0000 [thread overview]
Message-ID: <20230929211155.3910949-5-samitolvanen@google.com> (raw)
In-Reply-To: <20230929211155.3910949-4-samitolvanen@google.com>
Allow mmap_rnd_bits_max to be updated on architectures that
determine virtual address space size at runtime instead of relying
on Kconfig options by changing it from const to __ro_after_init.
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
include/linux/mm.h | 2 +-
mm/mmap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bf5d0b1b16f4..72a98b2afaf9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -86,7 +86,7 @@ extern int sysctl_legacy_va_layout;
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
extern const int mmap_rnd_bits_min;
-extern const int mmap_rnd_bits_max;
+extern int mmap_rnd_bits_max __ro_after_init;
extern int mmap_rnd_bits __read_mostly;
#endif
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
diff --git a/mm/mmap.c b/mm/mmap.c
index b56a7f0c9f85..ed1b178b223a 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -64,7 +64,7 @@
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
const int mmap_rnd_bits_min = CONFIG_ARCH_MMAP_RND_BITS_MIN;
-const int mmap_rnd_bits_max = CONFIG_ARCH_MMAP_RND_BITS_MAX;
+int mmap_rnd_bits_max __ro_after_init = CONFIG_ARCH_MMAP_RND_BITS_MAX;
int mmap_rnd_bits __read_mostly = CONFIG_ARCH_MMAP_RND_BITS;
#endif
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
--
2.42.0.582.g8ccd20d70d-goog
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Sami Tolvanen <samitolvanen@google.com>
To: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <keescook@chromium.org>
Cc: linux-mm@kvack.org, linux-riscv@lists.infradead.org,
llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
Sami Tolvanen <samitolvanen@google.com>
Subject: [PATCH 1/2] mm: Change mmap_rnd_bits_max to __ro_after_init
Date: Fri, 29 Sep 2023 21:11:57 +0000 [thread overview]
Message-ID: <20230929211155.3910949-5-samitolvanen@google.com> (raw)
In-Reply-To: <20230929211155.3910949-4-samitolvanen@google.com>
Allow mmap_rnd_bits_max to be updated on architectures that
determine virtual address space size at runtime instead of relying
on Kconfig options by changing it from const to __ro_after_init.
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
---
include/linux/mm.h | 2 +-
mm/mmap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bf5d0b1b16f4..72a98b2afaf9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -86,7 +86,7 @@ extern int sysctl_legacy_va_layout;
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
extern const int mmap_rnd_bits_min;
-extern const int mmap_rnd_bits_max;
+extern int mmap_rnd_bits_max __ro_after_init;
extern int mmap_rnd_bits __read_mostly;
#endif
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
diff --git a/mm/mmap.c b/mm/mmap.c
index b56a7f0c9f85..ed1b178b223a 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -64,7 +64,7 @@
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
const int mmap_rnd_bits_min = CONFIG_ARCH_MMAP_RND_BITS_MIN;
-const int mmap_rnd_bits_max = CONFIG_ARCH_MMAP_RND_BITS_MAX;
+int mmap_rnd_bits_max __ro_after_init = CONFIG_ARCH_MMAP_RND_BITS_MAX;
int mmap_rnd_bits __read_mostly = CONFIG_ARCH_MMAP_RND_BITS;
#endif
#ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
--
2.42.0.582.g8ccd20d70d-goog
next prev parent reply other threads:[~2023-09-29 21:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 21:11 [PATCH 0/2] riscv: Increase mmap_rnd_bits_max on Sv48/57 Sami Tolvanen
2023-09-29 21:11 ` Sami Tolvanen
2023-09-29 21:11 ` Sami Tolvanen [this message]
2023-09-29 21:11 ` [PATCH 1/2] mm: Change mmap_rnd_bits_max to __ro_after_init Sami Tolvanen
2023-09-29 21:55 ` Kees Cook
2023-09-29 21:55 ` Kees Cook
2023-09-29 21:11 ` [PATCH 2/2] riscv: mm: Update mmap_rnd_bits_max Sami Tolvanen
2023-09-29 21:11 ` Sami Tolvanen
2023-09-29 21:54 ` Kees Cook
2023-09-29 21:54 ` Kees Cook
2023-09-29 22:52 ` Sami Tolvanen
2023-09-29 22:52 ` Sami Tolvanen
2023-09-30 9:02 ` Conor Dooley
2023-09-30 9:02 ` Conor Dooley
2023-09-30 21:01 ` Kees Cook
2023-09-30 21:01 ` Kees Cook
2023-10-01 15:19 ` Pedro Falcato
2023-10-01 15:19 ` Pedro Falcato
2023-10-02 7:02 ` Alexandre Ghiti
2023-10-02 7:02 ` Alexandre Ghiti
2023-10-02 15:58 ` Sami Tolvanen
2023-10-02 15:58 ` Sami Tolvanen
2023-12-06 13:14 ` [PATCH 0/2] riscv: Increase mmap_rnd_bits_max on Sv48/57 Palmer Dabbelt
2023-12-06 13:14 ` Palmer Dabbelt
2023-12-06 20:28 ` Kees Cook
2023-12-06 20:28 ` Kees Cook
2024-01-17 20:29 ` Sami Tolvanen
2024-01-17 20:29 ` Sami Tolvanen
2024-01-25 21:30 ` patchwork-bot+linux-riscv
2024-01-25 21:30 ` patchwork-bot+linux-riscv
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=20230929211155.3910949-5-samitolvanen@google.com \
--to=samitolvanen@google.com \
--cc=akpm@linux-foundation.org \
--cc=aou@eecs.berkeley.edu \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.