[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFyZGC90uTgwq8T1oy7_Ld_AbJqa3vzVqsM-2iLrtKFYaA@mail.gmail.com>
Date: Thu, 16 Mar 2017 12:28:13 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...capital.net>,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH 4/5 v3] ftrace/x86_32: Clean up ftrace_regs_caller
On Thu, Mar 16, 2017 at 12:19 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
>
> The thing is we don't return, we jump to the location that may be
> modified to run the function graph tracer.
Hmm.
How about just making the stack frame a tiny bit bigger, and getting
rid of *all* the games.
IOW, just duplicate the return address, and make the entry code do
pushfl
pushl $__KERNEL_CS
pushl 8(%esp) /* Save the return ip *again* */
pushl $0
pushl %gs
pushl %fs
pushl %es
pushl %ds
pushl %eax
....
and not have any silly code to modify the old stack frame at all. Just
skip the values (all the segments, ORIG_EAX, duplicated return
address, __KERNEL_CS), and you can finish off with a "popf", and all
you have left i the original return ip that you didn't touch.
Hmm?
Linus
Powered by blists - more mailing lists