From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Luis Chamberlain <mcgrof@kernel.org>, Jessica Yu <jeyu@kernel.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"kgdb-bugreport@lists.sourceforge.net"
<kgdb-bugreport@lists.sourceforge.net>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: [PATCH v3 0/6] Allocate module text and data separately
Date: Sat, 29 Jan 2022 17:02:03 +0000 [thread overview]
Message-ID: <cover.1643475473.git.christophe.leroy@csgroup.eu> (raw)
This series allow architectures to request having modules data in
vmalloc area instead of module area.
This is required on powerpc book3s/32 in order to set data non
executable, because it is not possible to set executability on page
basis, this is done per 256 Mbytes segments. The module area has exec
right, vmalloc area has noexec. Without this change module data
remains executable regardless of CONFIG_STRICT_MODULES_RWX.
This can also be useful on other powerpc/32 in order to maximize the
chance of code being close enough to kernel core to avoid branch
trampolines.
Changes in v3:
- Fixed the tree for data_layout at one place (Thanks Miroslav)
- Moved removal of module_addr_min/module_addr_max macro out of patch 1 in a new patch at the end of the series to reduce churn.
Changes in v2:
- Dropped first two patches which are not necessary. They may be added back later as a follow-up series.
- Fixed the printks in GDB
Christophe Leroy (6):
modules: Always have struct mod_tree_root
modules: Prepare for handling several RB trees
modules: Introduce data_layout
modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC
modules: Remove module_addr_min and module_addr_max
powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and
8xx
arch/Kconfig | 6 ++
arch/powerpc/Kconfig | 1 +
include/linux/module.h | 8 ++
kernel/debug/kdb/kdb_main.c | 10 +-
kernel/module.c | 193 +++++++++++++++++++++++++-----------
5 files changed, 156 insertions(+), 62 deletions(-)
--
2.33.1
next reply other threads:[~2022-01-29 17:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 17:02 Christophe Leroy [this message]
2022-01-29 17:02 ` [PATCH v3 1/6] modules: Always have struct mod_tree_root Christophe Leroy
2022-01-29 17:02 ` [PATCH v3 2/6] modules: Prepare for handling several RB trees Christophe Leroy
2022-01-29 17:02 ` [PATCH v3 3/6] modules: Introduce data_layout Christophe Leroy
2022-02-02 23:48 ` Luis Chamberlain
2022-02-03 6:58 ` Christophe Leroy
2022-01-29 17:02 ` [PATCH v3 4/6] modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC Christophe Leroy
2022-02-03 0:01 ` Luis Chamberlain
2022-02-03 7:05 ` Christophe Leroy
2022-02-03 19:51 ` Luis Chamberlain
2022-02-08 18:40 ` Michal Suchánek
2022-01-29 17:02 ` [PATCH v3 5/6] modules: Remove module_addr_min and module_addr_max Christophe Leroy
2022-01-29 17:02 ` [PATCH v3 6/6] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Christophe Leroy
2022-02-03 0:05 ` [PATCH v3 0/6] Allocate module text and data separately Luis Chamberlain
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=cover.1643475473.git.christophe.leroy@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=jeyu@kernel.org \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mcgrof@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).