Re: [PATCH 1/3] module: deal with alignment issues in built-in module versions

Linus Torvalds
2011-02-17T18:07:31Z

On Thu, Feb 17, 2011 at 10:00 AM, Dmitry Torokhov <dtor@vmware.com> wrote:
>
> The problem is that on m68k size of the struct module_version_attribute
> is not evenly divisible by sizeof(void *), thus when we lay out the
> __modver section we align on 4 bytes but when we iterate we think that
> the alignment is 2.

So mark the struct properly.

> I/Geert tried adding __attribute__ (aligned(sizeof(void *))) to the type
> definition itself so we have matching alignment everywhere, but DaveM
> said that this only guarantees minimum alignment and that using
> structures like we do shown to break from time to time in kprobes and
> that only pointers worked reliably.

That sounds totally bogus. Minimum alignment is all it needs, and we
do that in other places too. I really don't see the reason to add some
broken indirection for totally broken reasons. We don't do that with
anything else.

David, why are you saying that regular "just mark the structure
alignment correctly" doesn't work?

Linus