linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Dmitry Torokhov <dtor@vmware.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, linux-m68k@vger.kernel.org,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH 1/3] module: deal with alignment issues in built-in module versions
Date: Mon, 21 Feb 2011 14:25:58 +0100	[thread overview]
Message-ID: <AANLkTin_vp=+G+AMsfRtet9aWFc4MQnRC_bFZOovvFyg@mail.gmail.com> (raw)
In-Reply-To: <20110221074947.GA31152@dtor-ws.eng.vmware.com>

On Mon, Feb 21, 2011 at 08:49, Dmitry Torokhov <dtor@vmware.com> wrote:
> On Mon, Feb 21, 2011 at 08:38:46AM +0100, Geert Uytterhoeven wrote:
>> On Mon, Feb 21, 2011 at 05:00, Rusty Russell <rusty@rustcorp.com.au> wrote:
>> >> Except that .long is 32-bit on ppc64 :-( You need .llong for 64-bit.
>> >
>> > OK, all options suck.  Do we want the workaround or not?
>>
>> We can discuss about that until someone gets bitten by that.
>>
>> But please fix the "aligned(sizeof(void *))"-in-one-place-only issue.
>>
>
> How about this one then?

Works.

> From f0e0e10b58b22047e36e21a022abf5e86b5819c2 Mon Sep 17 00:00:00 2001
> From: Dmitry Torokhov <dtor@vmware.com>
> Date: Fri, 4 Feb 2011 13:30:10 -0800
> Subject: [PATCH] module: explicitly align module_version_attribute structure
>
> We force particular alignment when we generate attribute structures
> when generation MODULE_VERSION() data and we need to make sure that
> this alignment is followed when we iterate over these structures,
> otherwise we may crash on platforms whose natural alignment is not
> sizeof(void *), such as m68k.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Dmitry Torokhov <dtor@vmware.com>

Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

> ---
>  include/linux/module.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/module.h b/include/linux/module.h
> index e7c6385..de5cd21 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -62,7 +62,7 @@ struct module_version_attribute {
>        struct module_attribute mattr;
>        const char *module_name;
>        const char *version;
> -};
> +} __attribute__ ((__aligned__(sizeof(void *))));
>
>  struct module_kobject
>  {
> --
> 1.7.3.2

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

  parent reply	other threads:[~2011-02-21 13:25 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  0:02 [PATCH 1/3] module: deal with alignment issues in built-in module versions Dmitry Torokhov
2011-02-08  0:02 ` [PATCH 2/3] module: deal with alignment issues in built-in module parameters Dmitry Torokhov
2011-02-08  0:02 ` [PATCH 3/3] module: do not hide __modver_version_show declaration behind ifdef Dmitry Torokhov
2011-02-08 21:12 ` [PATCH 1/3] module: deal with alignment issues in built-in module versions Geert Uytterhoeven
2011-02-08 21:12   ` Geert Uytterhoeven
2011-02-17 12:43   ` Geert Uytterhoeven
2011-02-17 12:43     ` Geert Uytterhoeven
2011-02-11 22:03 ` [PATCH v2] module: deal with alignment issues in built-in module parameters Dmitry Torokhov
2011-02-13 23:04   ` Rusty Russell
2011-02-13 23:04     ` Rusty Russell
2011-02-17 17:24 ` [PATCH 1/3] module: deal with alignment issues in built-in module versions Linus Torvalds
2011-02-17 17:24   ` Linus Torvalds
2011-02-17 17:31   ` Dmitry Torokhov
2011-02-17 17:31     ` Dmitry Torokhov
2011-02-17 17:45     ` Linus Torvalds
2011-02-17 17:45       ` Linus Torvalds
2011-02-17 18:00       ` Dmitry Torokhov
2011-02-17 18:06         ` Linus Torvalds
2011-02-17 18:06           ` Linus Torvalds
2011-02-17 21:01           ` David Miller
2011-02-17 21:01             ` David Miller
2011-02-17 21:11             ` Linus Torvalds
2011-02-17 21:17               ` David Miller
2011-02-17 21:54                 ` Linus Torvalds
2011-02-17 22:01                   ` David Miller
2011-02-17 22:19                     ` Dmitry Torokhov
2011-02-17 22:23                       ` David Miller
2011-02-17 22:23                         ` David Miller
2011-02-17 22:48                         ` Linus Torvalds
2011-02-17 22:48                           ` Linus Torvalds
2011-02-17 23:08                           ` Linus Torvalds
2011-02-17 23:19                             ` David Miller
2011-02-19  0:14                             ` Benjamin Herrenschmidt
2011-02-21  4:00                               ` Rusty Russell
2011-02-21  4:00                                 ` Rusty Russell
2011-02-21  7:38                                 ` Geert Uytterhoeven
2011-02-21  7:49                                   ` Dmitry Torokhov
2011-02-21  7:49                                     ` Dmitry Torokhov
2011-02-21 13:25                                     ` Geert Uytterhoeven [this message]
2011-02-21 13:25                                       ` Geert Uytterhoeven
2011-02-22  1:58                                 ` Benjamin Herrenschmidt
2011-02-22  1:58                                   ` Benjamin Herrenschmidt
2011-02-22  2:03                                   ` Linus Torvalds
2011-02-22  2:03                                     ` Linus Torvalds
2011-02-22  7:02                                     ` Dmitry Torokhov
2011-02-22 17:08                                       ` Jesper Nilsson
2011-02-22 20:47                                         ` Linus Torvalds
2011-02-22 20:47                                           ` Linus Torvalds
2011-02-23 15:00                                           ` Jesper Nilsson

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='AANLkTin_vp=+G+AMsfRtet9aWFc4MQnRC_bFZOovvFyg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=dtor@vmware.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --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;
as well as URLs for NNTP newsgroup(s).