All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ard Biesheuvel" <ardb+git@google.com>
Cc: linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/9] module: Place MOD_TEXT before MOD_INIT_TEXT in enumeration
Date: Sat, 22 Aug 2026 14:05:50 +0000	[thread overview]
Message-ID: <20260822140551.1B10C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260822135323.795946-14-ardb+git@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The reordering of `enum mod_mem_type` breaks the `lx-lsmod` GDB script command, causing it to report a core module size of 0 for all loaded modules.
--

--- Patch [3]: [RFC PATCH 3/9] module: Place MOD_TEXT before MOD_INIT_TEXT in enumeration ---
commit 5a5649e85e950b908f9830e5862b49ac415dfa18
Author: Ard Biesheuvel <ardb@kernel.org>

module: Place MOD_TEXT before MOD_INIT_TEXT in enumeration

This commit reorders enum mod_mem_type so that MOD_TEXT appears right
before MOD_INIT_TEXT. This ensures MOD_INIT_TEXT is allocated immediately
after MOD_TEXT, reducing fragmentation when truncating allocations in
subsequent patches.

> diff --git a/include/linux/module.h b/include/linux/module.h
> index 7566815fabbe8..0336a46733dd9 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -316,10 +316,10 @@ struct mod_tree_node {
>  };
>  
>  enum mod_mem_type {
> -	MOD_TEXT = 0,
> -	MOD_DATA,
> +	MOD_DATA = 0,
>  	MOD_RODATA,
>  	MOD_RO_AFTER_INIT,
> +	MOD_TEXT,

[Severity: Medium]
Does this reordering break the lx-lsmod GDB script command?

In scripts/gdb/linux/modules.py:LxLsmod.invoke(), the total size of a 
module's core sections is computed by iterating over the memory regions:

for i in range(constants.LX_MOD_TEXT, constants.LX_MOD_RO_AFTER_INIT + 1):
    total_size += module['mem'][i]['size']

Because MOD_TEXT now evaluates to 3 and MOD_RO_AFTER_INIT evaluates to 2
with this change, the Python iteration evaluates to range(3, 3). This
generates an empty sequence and the total_size remains 0 for all loaded
modules.

>  	MOD_INIT_TEXT,
>  	MOD_INIT_DATA,
>  	MOD_INIT_RODATA,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260822135323.795946-11-ardb+git@google.com?part=3

  reply	other threads:[~2026-08-22 14:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-22 13:53 [RFC PATCH 0/9] arm64: Allocate .text and .init.text together Ard Biesheuvel
2026-08-22 13:53 ` [RFC PATCH 1/9] mm: execmem: Add API to split an existing execmem cache allocation Ard Biesheuvel
2026-08-22 13:53 ` [RFC PATCH 2/9] mm: execmem: Allow huge vmappings to be avoided for execmem caches Ard Biesheuvel
2026-08-22 14:10   ` sashiko-bot
2026-08-22 13:53 ` [RFC PATCH 3/9] module: Place MOD_TEXT before MOD_INIT_TEXT in enumeration Ard Biesheuvel
2026-08-22 14:05   ` sashiko-bot [this message]
2026-08-22 13:53 ` [RFC PATCH 4/9] module: Allocate MOD_INIT_TEXT from the MOD_TEXT ROX allocation Ard Biesheuvel
2026-08-28 14:11   ` Bradley Morgan
2026-08-22 13:53 ` [RFC PATCH 5/9] arm64: mm: Permit permissions changes on huge vmappings Ard Biesheuvel
2026-08-22 14:10   ` sashiko-bot
2026-08-23 16:52   ` Adrian Barnaś
2026-08-22 13:53 ` [RFC PATCH 6/9] arm64: Enable the execmem ROX cache for module text Ard Biesheuvel
2026-08-22 14:13   ` sashiko-bot
2026-08-23 16:46   ` Adrian Barnaś
2026-08-22 13:53 ` [RFC PATCH 7/9] arm64: ftrace: Revert "fix unreachable PLT for ftrace_caller ..." Ard Biesheuvel
2026-08-22 13:53 ` [RFC PATCH 8/9] arm64: module: Combine init and core PLT entries again Ard Biesheuvel
2026-08-22 14:12   ` sashiko-bot
2026-08-22 13:53 ` [RFC PATCH 9/9] arm64: ftrace: Simplify PLT handling Ard Biesheuvel
2026-08-28 13:07 ` [RFC PATCH 0/9] arm64: Allocate .text and .init.text together Petr Pavlu
2026-08-28 13:45   ` Ard Biesheuvel
2026-08-31 13:30     ` Petr Pavlu
2026-09-02 17:23 ` Mike Rapoport

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=20260822140551.1B10C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ardb+git@google.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.