linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Cc: songliubraving@fb.com, Luis Chamberlain <mcgrof@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH/RFC] module: replace module_layout with module_memory
Date: Tue, 10 Jan 2023 10:31:54 -0800	[thread overview]
Message-ID: <CAPhsuW4oY6Gh2c11AvzoCrv7ZShT0E=zU0OgK8LUq_pYW9=edw@mail.gmail.com> (raw)
In-Reply-To: <20230106220959.3398792-1-song@kernel.org>

+ Christoph

Hi folks,

Could you please share your comments on this work? If there isn't
major issue with it, maybe we can ship it in 6.3? (so we don't pile
too many changes in one big set).

Thanks,
Song

On Fri, Jan 6, 2023 at 2:10 PM Song Liu <song@kernel.org> wrote:
>
> module_layout manages different types of memory (text, data, rodata, etc.)
> in one allocation, which is problematic for some reasons:
>
> 1. It is hard to enable CONFIG_STRICT_MODULE_RWX.
> 2. It is hard to use huge pages in modules (and not break strict rwx).
> 3. Many archs uses module_layout for arch-specific data, but it is not
>    obvious how these data are used (are they RO, RX, or RW?)
>
> Improve the scenario by replacing 2 (or 3) module_layout per module with
> up to 7 module_memory per module:
>
>         MOD_MEM_TYPE_TEXT,
>         MOD_MEM_TYPE_DATA,
>         MOD_MEM_TYPE_RODATA,
>         MOD_MEM_TYPE_RO_AFTER_INIT,
>         MOD_MEM_TYPE_INIT_TEXT,
>         MOD_MEM_TYPE_INIT_DATA,
>         MOD_MEM_TYPE_INIT_RODATA,
>
> and allocating them separately.
>
> Various archs use module_layout for different data. These data are put
> into different module_memory based on their location in module_layout.
> IOW, data that used to go with text is allocated with MOD_MEM_TYPE_TEXT;
> data that used to go with data is allocated with MOD_MEM_TYPE_DATA, etc.
>
> Signed-off-by: Song Liu <song@kernel.org>
> Cc: Luis Chamberlain <mcgrof@kernel.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Peter Zijlstra <peterz@infradead.org>

[...]

  parent reply	other threads:[~2023-01-10 18:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 22:09 [PATCH/RFC] module: replace module_layout with module_memory Song Liu
2023-01-09 18:03 ` Christophe Leroy
2023-01-09 18:24   ` Song Liu
2023-01-09 20:51     ` Song Liu
2023-01-10  6:31       ` Christophe Leroy
2023-01-10  6:51         ` Song Liu
2023-01-18 15:07         ` Peter Zijlstra
2023-01-18 17:52           ` Song Liu
2023-01-10 18:31 ` Song Liu [this message]
2023-01-17 18:50   ` Song Liu
2023-01-18  7:40     ` Christoph Hellwig
2023-01-18 17:37       ` Song Liu
2023-01-18 21:52       ` Song Liu
2023-01-19  5:35         ` Christoph Hellwig
2023-01-19  8:29           ` Song Liu
2023-01-20 17:42             ` Song Liu
2023-01-23  6:57               ` Christoph Hellwig
2023-01-24 18:01                 ` Song Liu

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='CAPhsuW4oY6Gh2c11AvzoCrv7ZShT0E=zU0OgK8LUq_pYW9=edw@mail.gmail.com' \
    --to=song@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    --cc=tglx@linutronix.de \
    /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).