[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110207165829.GA13101@dtor-ws.eng.vmware.com>
Date: Mon, 7 Feb 2011 08:58:29 -0800
From: Dmitry Torokhov <dtor@...are.com>
To: David Miller <davem@...emloft.net>
Cc: "schwab@...ux-m68k.org" <schwab@...ux-m68k.org>,
"geert@...ux-m68k.org" <geert@...ux-m68k.org>,
"rusty@...tcorp.com.au" <rusty@...tcorp.com.au>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-m68k@...r.kernel.org" <linux-m68k@...r.kernel.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: Early crash
On Mon, Feb 07, 2011 at 12:50:10AM -0800, David Miller wrote:
> From: Dmitry Torokhov <dtor@...are.com>
> Date: Mon, 7 Feb 2011 00:19:33 -0800
>
> > So here is the patch that explicitly specifies alignment for struct
> > module_version_attribute. I tested it on i386 and x86_64 and I believe
> > it will fix the issue with m68k but I do not have access to such a box.
>
> While this may or may not fix the m68k issue, this isn't really
> sufficient to make this thing work in all cases. And the older
> tracepoint commits referenced in this thread are known to cause
> problems with platforms such as sparc64.
>
> You can't reliably put structures into independent objects, put them
> into a special section, and then expect array access over them (via
> the section boundaries) after linking the objects together to just
> "work".
>
> Your attribute specification is only a lower-bound.
Right.
>
> GCC can and does use variable alignment choices in different situations,
> so the align directive in the various objects can all be different. So
> the array iteration will assume the iterations should use one object
> size, but within the linked together section the alignments are all
> different so the inter-struct gap is different.
>
> The only portable mechanism that will work in all cases, as we've
> found recently for tracepoints and similar, is to make an array of
> plain pointers to the objects in the special section.
But, theoretically speaking, nothing stops GCC to align pointers with
"gaps" as well? Let's say having everything (or some) aligned on
quadword boundary even though arch is 32 bit?
Thanks,
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists