[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B0C3A2F.20703@zytor.com>
Date: Tue, 24 Nov 2009 11:55:27 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Andrew Haley <aph@...hat.com>
CC: Jakub Jelinek <jakub@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H.J. Lu" <hjl.tools@...il.com>, rostedt@...dmis.org,
Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Heiko Carstens <heiko.carstens@...ibm.com>,
feng.tang@...el.com, Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
David Daney <ddaney@...iumnetworks.com>,
Richard Guenther <richard.guenther@...il.com>,
gcc <gcc@....gnu.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC
messing with mcount prologue
On 11/24/2009 09:12 AM, Andrew Haley wrote:
>>
>> If we're changing gcc anyway, then let's add the option of intercepting
>> the function at the point where the machine state is well-defined by
>> ABI, which is before the function stack frame is set up.
>
> Hmm. On the x86 I suppose we could just inject a naked call instruction,
> but not all aeches allow us to call anything before we've saved the return
> address. Or are you talking x86 only?
>
For x86, we should use a naked call.
For architectures where that is not possible, we should use a minimal
sequence such that the ABI state at the invocation point is 100% derivable.
On MIPS, for example, we could use a sequence such as:
mov at, ra
jal __fentry__
It would be up to __fentry__ to save the value in at and to restore it
back into ra before resuming, meaning that __fentry__ has a nonstandard
calling convention.
-hpa
--
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