linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Ard Biesheuvel <ardb+git@google.com>
Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	 Nathan Chancellor <nathan@kernel.org>,
	Kent Overstreet <kent.overstreet@linux.dev>,
	 Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org, linux-mm@kvack.org,
	 linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 1/2] codetag: Use dot prefix for section name
Date: Mon, 14 Oct 2024 14:16:52 -0700	[thread overview]
Message-ID: <CAJuCfpGXBH0FQppLppSkCLeRwCJsAGUMWL6F+G1TdqU4d=q4og@mail.gmail.com> (raw)
In-Reply-To: <20241014125703.2287936-5-ardb+git@google.com>

On Mon, Oct 14, 2024 at 5:57 AM Ard Biesheuvel <ardb+git@google.com> wrote:
>
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Sections typically use leading dots in their names, and deviating from
> this breaks some assumptions in the existing code, e.g., in strip_relocs
> on x86, which filters out .rela.* and .rela__* sections.
>
>   [65] alloc_tags        PROGBITS         0000000000000000  03a57958
>        0000000000026340  0000000000000000  WA       0     0     8
>   [66] .relaalloc_tags   RELA             0000000000000000  08dbb868
>        0000000000044c40  0000000000000018   I      280    65     8
>
> So use a leading dot for the alloc_tags sections.

No issues with renaming the section but please note that I posted a
patch [1] today that will have conflicts with this renaming.

[1] https://lore.kernel.org/all/20241014203646.1952505-3-surenb@google.com/

>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
>  include/asm-generic/codetag.lds.h | 2 +-
>  include/linux/alloc_tag.h         | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/asm-generic/codetag.lds.h b/include/asm-generic/codetag.lds.h
> index 64f536b80380..dcd18351ba2f 100644
> --- a/include/asm-generic/codetag.lds.h
> +++ b/include/asm-generic/codetag.lds.h
> @@ -5,7 +5,7 @@
>  #define SECTION_WITH_BOUNDARIES(_name) \
>         . = ALIGN(8);                   \
>         __start_##_name = .;            \
> -       KEEP(*(_name))                  \
> +       KEEP(*(. ## _name))             \
>         __stop_##_name = .;

I think leaving the SECTION_WITH_BOUNDARIES() definition as is and
changing its users to pass the name with the dot would be more
explicit and more flexible.
The only user today is CODETAG_SECTIONS() at [2], so I would add the
dot in there instead.

[2] https://elixir.bootlin.com/linux/v6.12-rc2/source/include/asm-generic/codetag.lds.h#L12

Thanks,
Suren.

>
>  #define CODETAG_SECTIONS()             \
> diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h
> index 1f0a9ff23a2c..d45a8a582970 100644
> --- a/include/linux/alloc_tag.h
> +++ b/include/linux/alloc_tag.h
> @@ -76,7 +76,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag);
>
>  #define DEFINE_ALLOC_TAG(_alloc_tag)                                           \
>         static struct alloc_tag _alloc_tag __used __aligned(8)                  \
> -       __section("alloc_tags") = {                                             \
> +       __section(".alloc_tags") = {                                            \
>                 .ct = CODE_TAG_INIT,                                            \
>                 .counters = &_shared_alloc_tag };
>
> @@ -85,7 +85,7 @@ DECLARE_PER_CPU(struct alloc_tag_counters, _shared_alloc_tag);
>  #define DEFINE_ALLOC_TAG(_alloc_tag)                                           \
>         static DEFINE_PER_CPU(struct alloc_tag_counters, _alloc_tag_cntr);      \
>         static struct alloc_tag _alloc_tag __used __aligned(8)                  \
> -       __section("alloc_tags") = {                                             \
> +       __section(".alloc_tags") = {                                            \
>                 .ct = CODE_TAG_INIT,                                            \
>                 .counters = &_alloc_tag_cntr };
>
> --
> 2.47.0.rc1.288.g06298d1525-goog
>


  reply	other threads:[~2024-10-14 21:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 12:57 [PATCH 0/2] Use dot prefixes for section names Ard Biesheuvel
2024-10-14 12:57 ` [PATCH 1/2] codetag: Use dot prefix for section name Ard Biesheuvel
2024-10-14 21:16   ` Suren Baghdasaryan [this message]
2024-10-14 12:57 ` [PATCH 2/2] runtime-const: Use dot prefix for section names Ard Biesheuvel
2024-10-14 17:29 ` [PATCH 0/2] Use dot prefixes " Linus Torvalds
2024-10-14 17:43   ` Ard Biesheuvel
2024-10-14 18:10     ` Linus Torvalds
2024-10-14 18:19       ` Ard Biesheuvel
2024-10-15 12:08         ` Petr Mladek

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='CAJuCfpGXBH0FQppLppSkCLeRwCJsAGUMWL6F+G1TdqU4d=q4og@mail.gmail.com' \
    --to=surenb@google.com \
    --cc=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=torvalds@linux-foundation.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