<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/compiler-gcc.h, branch v3.9.8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-02-22T01:22:15Z</updated>
<entry>
<title>compiler-gcc.h: Add gcc-recommended GCC_VERSION macro</title>
<updated>2013-02-22T01:22:15Z</updated>
<author>
<name>Daniel Santos</name>
<email>daniel.santos@pobox.com</email>
</author>
<published>2013-02-22T00:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16'/>
<id>urn:sha1:3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16</id>
<content type='text'>
Throughout compiler*.h, many version checks are made.  These can be
simplified by using the macro that gcc's documentation recommends.
However, my primary reason for adding this is that I need bug-check
macros that are enabled at certain gcc versions and it's cleaner to use
this macro than the tradition method:

  #if __GNUC__ &gt; 4 || (__GNUC__ == 4 &amp;&amp; __GNUC_MINOR__ =&gt; 2)

If you add patch level, it gets this ugly:

  #if __GNUC__ &gt; 4 || (__GNUC__ == 4 &amp;&amp; (__GNUC_MINOR__ &gt; 2 || \
      __GNUC_MINOR__ == 2 __GNUC_PATCHLEVEL__ &gt;= 1))

As opposed to:

  #if GCC_VERSION &gt;= 40201

While having separate headers for gcc 3 &amp; 4 eliminates some of this
verbosity, they can still be cleaned up by this.

See also:

  http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html

Signed-off-by: Daniel Santos &lt;daniel.santos@pobox.com&gt;
Acked-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Make all inline tags also include notrace</title>
<updated>2012-06-18T13:47:00Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2012-06-14T14:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=93b3cca1ccd30b1ad290951a3fc7c10c73db7313'/>
<id>urn:sha1:93b3cca1ccd30b1ad290951a3fc7c10c73db7313</id>
<content type='text'>
Commit 5963e317b1e9d2a ("ftrace/x86: Do not change stacks in DEBUG when
calling lockdep") prevented lockdep calls from the int3 breakpoint handler
from reseting the stack if a function that was called was in the process
of being converted for tracing and had a breakpoint on it. The idea is,
before calling the lockdep code, do a load_idt() to the special IDT that
kept the breakpoint stack from reseting. This worked well as a quick fix
for this kernel release, until a certain config caused a lockup in the
function tracer start up tests.

Investigating it, I found that the load_idt that was used to prevent
the int3 from changing stacks was itself being traced!

Even though the config had CONFIG_OPTIMIZE_INLINING disabled, and
all 'inline' tags were set to always inline, there were still cases that
it did not inline! This was caused by CONFIG_PARAVIRT_GUEST, where it
would add a pointer to the native_load_idt() which made that function
to be traced.

Commit 45959ee7aa645815a ("ftrace: Do not function trace inlined functions")
only touched the 'inline' tags when CONFIG_OPMITIZE_INLINING was enabled.
PARAVIRT_GUEST shows that this was not enough and we need to also
mark always_inline with notrace as well.

Reported-by: Fengguang Wu &lt;wfg@linux.intel.com&gt;
Tested-by: Fengguang Wu &lt;wfg@linux.intel.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...)</title>
<updated>2012-03-23T23:58:36Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-03-23T22:02:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6061d949dd984c762ee272a88e77699fa675d1c8'/>
<id>urn:sha1:6061d949dd984c762ee272a88e77699fa675d1c8</id>
<content type='text'>
It's equivalent to __printf, so prefer __scanf.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Do not function trace inlined functions</title>
<updated>2011-12-21T12:14:34Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-12-12T20:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=45959ee7aa645815a5ce303a0ea1e48a21e67c6a'/>
<id>urn:sha1:45959ee7aa645815a5ce303a0ea1e48a21e67c6a</id>
<content type='text'>
When gcc inlines a function, it does not mark it with the mcount
prologue, which in turn means that inlined functions are not traced
by the function tracer. But if CONFIG_OPTIMIZE_INLINING is set, then
gcc is allowed not to inline a function that is marked inline.

Depending on the options and the compiler, a function may or may
not be traced by the function tracer, depending on whether gcc
decides to inline a function or not. This has caused several
problems in the pass becaues gcc is not always consistent with
what it decides to inline between different gcc versions.

Some places should not be traced (like paravirt native_* functions)
and these are mostly marked as inline. When gcc decides not to
inline the function, and if that function should not be traced, then
the ftrace function tracer will suddenly break when it use to work
fine. This becomes even harder to debug when different versions of
gcc will not inline that function, making the same kernel and config
work for some gcc versions and not work for others.

By making all functions marked inline to not be traced will remove
the ambiguity that gcc adds when it comes to tracing functions marked
inline. All gcc versions will be consistent with what functions are
traced and having volatile working code will be removed.

Note, only the inline macro when CONFIG_OPTIMIZE_INLINING is set needs
to have notrace added, as the attribute __always_inline will force
the function to be inlined and then not traced.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>sparse: define __must_be_array() for __CHECKER__</title>
<updated>2011-05-25T15:39:46Z</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2011-05-25T00:13:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5bd7e6a30e1eb38f58f0046c0cd42dfc38e90d64'/>
<id>urn:sha1:5bd7e6a30e1eb38f58f0046c0cd42dfc38e90d64</id>
<content type='text'>
commit c5e631cf65f ("ARRAY_SIZE: check for type") added __must_be_array().
But sparse can't parse this gcc extention.

Now make C=2 makes following sparse errors a lot.

  kernel/futex.c:2699:25: error: No right hand side of '+'-expression

Because __must_be_array() is used for ARRAY_SIZE() macro and it is
used very widely.

This patch fixes it.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Dave Hansen &lt;dave@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>include/linux/compiler-gcc*.h: unify macro definitions</title>
<updated>2011-03-23T00:44:10Z</updated>
<author>
<name>Borislav Petkov</name>
<email>borislav.petkov@amd.com</email>
</author>
<published>2011-03-22T23:33:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c837fb37a60aa642b9ad423462e32b851a03020a'/>
<id>urn:sha1:c837fb37a60aa642b9ad423462e32b851a03020a</id>
<content type='text'>
Unify identical gcc3.x and gcc4.x macros.

Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>include/linux/compiler-gcc.h: use __same_type() in __must_be_array()</title>
<updated>2010-08-10T03:45:04Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2010-08-10T00:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ea6b101d8a3ea4e1dec29df31188c2f9852296fe'/>
<id>urn:sha1:ea6b101d8a3ea4e1dec29df31188c2f9852296fe</id>
<content type='text'>
We should use the __same_type() helper in __must_be_array().

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>compiler-gcc.h: gcc-4.5 needs noclone and noinline on __naked functions</title>
<updated>2010-06-29T22:29:31Z</updated>
<author>
<name>Mikael Pettersson</name>
<email>mikpe@it.uu.se</email>
</author>
<published>2010-06-29T22:05:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9c695203a7ddbe49dba5f22f4c941d24f47475df'/>
<id>urn:sha1:9c695203a7ddbe49dba5f22f4c941d24f47475df</id>
<content type='text'>
A __naked function is defined in C but with a body completely implemented
by asm(), including any prologue and epilogue.  These asm() bodies expect
standard calling conventions for parameter passing.  Older GCCs implement
that correctly, but 4.[56] currently do not, see GCC PR44290.  In the
Linux kernel this breaks ARM, causing most arch/arm/mm/copypage-*.c
modules to get miscompiled, resulting in kernel crashes during bootup.

Part of the kernel fix is to augment the __naked function attribute to
also imply noinline and noclone.  This patch implements that, and has been
verified to fix boot failures with gcc-4.5 compiled 2.6.34 and 2.6.35-rc1
kernels.  The patch is a no-op with older GCCs.

Signed-off-by: Mikael Pettersson &lt;mikpe@it.uu.se&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>compiler: Introduce __always_unused</title>
<updated>2009-11-02T14:47:54Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-11-02T00:50:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b2a35132ad0a70902dcd2844c27ed64cda0ce9b'/>
<id>urn:sha1:7b2a35132ad0a70902dcd2844c27ed64cda0ce9b</id>
<content type='text'>
I wrote some code which is used as compile-time checker, and the
code should be elided after compile.

So I need to annotate the code as "always unused", compared to
"maybe unused".

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
LKML-Reference: &lt;4AEE2CEC.8040206@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>[ARM] 5421/1: ftrace: fix crash due to tracing of __naked functions</title>
<updated>2009-03-12T21:33:03Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2009-03-12T17:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=446c92b2901bedb3725d29b4e73def8aba623ffc'/>
<id>urn:sha1:446c92b2901bedb3725d29b4e73def8aba623ffc</id>
<content type='text'>
This is a fix for the following crash observed in 2.6.29-rc3:
http://lkml.org/lkml/2009/1/29/150

On ARM it doesn't make sense to trace a naked function because then
mcount is called without stack and frame pointer being set up and there
is no chance to restore the lr register to the value before mcount was
called.

Reported-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;
Tested-by: Matthias Kaehlcke &lt;matthias@kaehlcke.net&gt;

Cc: Abhishek Sagar &lt;sagar.abhishek@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@home.goodmis.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
