public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ftrace: fix ftrace_event_call alignment for use with gcc 4.5
Date: Wed, 24 Feb 2010 14:33:20 -0500	[thread overview]
Message-ID: <4B857F00.10005@suse.com> (raw)
In-Reply-To: <4B85770B.6010901@suse.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/24/2010 01:59 PM, Jeff Mahoney wrote:
>  GCC 4.5 introduces behavior that forces the alignment of structures to
>  use the largest possible value. The default value is 32 bytes, so if
>  some structures are defined with a 4-byte alignment and others aren't
>  declared with an alignment constraint at all - it will align at 32-bytes.
> 
>  For things like the ftrace events, this results in a non-standard array.
>  When initializing the ftrace subsystem, we traverse the _ftrace_events
>  section and call the initialization callback for each event. When the
>  structures are misaligned, we could be treating another part of the
>  structure (or the zeroed out space between them) as a function pointer.
> 
>  This patch forces the alignment for all the ftrace_event_call structures
>  to 4 bytes.
> 
>  Without this patch, the kernel fails to boot very early when built with
>  gcc 4.5.
> 
>  It's trivial to check the alignment of the members of the array, so it
>  might be worthwhile to add something to the build system to do that
>  automatically. Unfortunately, that only covers this case. I've asked one
>  of the gcc developers about adding a warning when this condition is seen.

BTW, the analysis for this is available here:

https://bugzilla.novell.com/show_bug.cgi?id=582222

- -Jeff

- -- 
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iEYEARECAAYFAkuFfwAACgkQLPWxlyuTD7KvZgCgluUzuO91K0wARk0SaLJeCV7x
we0AnAjPT/M1c4wD0Ti6mUjsZjKx5CXX
=zJLJ
-----END PGP SIGNATURE-----

  reply	other threads:[~2010-02-24 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 18:59 [PATCH] ftrace: fix ftrace_event_call alignment for use with gcc 4.5 Jeff Mahoney
2010-02-24 19:33 ` Jeff Mahoney [this message]
2010-02-25 14:09   ` Steven Rostedt
2010-02-26  9:27 ` [tip:tracing/core] tracing: Fix " tip-bot for Jeff Mahoney

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=4B857F00.10005@suse.com \
    --to=jeffm@suse.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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