All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yann Sionneau <ysionneau@kalray.eu>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [RFC PATCH 1/1] Fix __kcrctab+* sections alignment
Date: Fri, 26 Aug 2022 12:17:08 +0200	[thread overview]
Message-ID: <CAMj1kXF6TchD4g0qO1OeEwt8QYU_TZEriE=1yaCxXrNGBYjmCA@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdUJZBPuD1=3SMg4G1-UoBr5Evd8mBfhxxuAaoh=K6Rm+w@mail.gmail.com>

On Thu, 25 Aug 2022 at 20:01, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Ard,
>
> On Thu, Aug 25, 2022 at 2:56 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> > On Thu, 25 Aug 2022 at 14:21, Yann Sionneau <ysionneau@kalray.eu> wrote:
> > > Well, I am not completely sure about that. See my cover letter, previous
> > > mechanism for symbol CRC was actually enforcing the section alignment to
> > > 4 bytes boundary as well.
>
> Yes, because else it may become 2-byte aligned on m68k.
>
> > > Also, I'm not sure it is forbidden for an architecture/compiler
> > > implementation to actually enforce a stronger alignment on u32, which in
> > > theory would not break anything.
> > >
> >
> > u32 is a Linux type, and Linux expects natural alignment (and padding).
>
> Is it? You probably mean its alignment should not be larger than
> 4 bytes? Less has been working since basically forever.
>

You are quite right. of course. And indeed, the issue here is padding
not alignment.


> > So if your toolchain/architecture violates this rule, I suggest you
> > typedef u32 to 'unsigned int __aligned(4)' explicitly. so that things
> > don't break in other places.
> >
> > However, even then, I am highly skeptical. This really seems like an
> > issue in your toolchain that could cause problems all over the place.
> >
> > > But in this precise case it does break something since it will cause
> > > "gaps" in the end result vmlinux binary segment. For this to work I
> > > think we really want to enforce a 4 bytes alignment on the section.
> >
> > You are addressing one of many potential issues that could be caused
> > by this, so I don't think this patch is a good idea tbh.
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  reply	other threads:[~2022-08-26 10:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 16:14 [RFC PATCH 0/1] Fix __kcrctab+* sections alignment Yann Sionneau
2022-08-17 16:14 ` [RFC PATCH 1/1] " Yann Sionneau
2022-08-25 12:03   ` Fwd: " Yann Sionneau
2022-08-25 12:12     ` Ard Biesheuvel
2022-08-25 12:21       ` Yann Sionneau
2022-08-25 12:41         ` Ard Biesheuvel
2022-08-25 18:01           ` Geert Uytterhoeven
2022-08-26 10:17             ` Ard Biesheuvel [this message]
2022-08-28 14:05               ` Masahiro Yamada
2022-09-05 15:26                 ` Yann Sionneau
2022-09-26  8:48                 ` Yann Sionneau
2022-09-26  9:05                   ` Masahiro Yamada
2022-09-26  9:11                     ` Ard Biesheuvel
2022-09-26  9:05                   ` Ard Biesheuvel
2022-08-28 13:41         ` Masahiro Yamada
2022-08-28 13:59         ` Masahiro Yamada
2022-09-05 13:56           ` Yann Sionneau
2022-08-25 12:03 ` Fwd: [RFC PATCH 0/1] " Yann Sionneau

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='CAMj1kXF6TchD4g0qO1OeEwt8QYU_TZEriE=1yaCxXrNGBYjmCA@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=ysionneau@kalray.eu \
    /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.