[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFwuqLGXKX=CkK6Ywoh-JNXdXtqdJhonqubRQQSEroc=dA@mail.gmail.com>
Date: Thu, 16 Mar 2017 11:19:44 -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 11:09 AM, Steven Rostedt <rostedt@...dmis.org> wrote:
> +
> + /* Since we don't care about cs, move flags there to simplify return */
> + movl 14*4(%esp), %eax
> + movl %eax, 13*4(%esp)
> +
> + /* Move return ip back to its original location */
> + movl 12*4(%esp), %eax
> + movl %eax, 14*4(%esp)
Could this perhaps be removed entirely?
The return code could instead do:
... restore all the normal registers ..
# Now restore flags that is under the return address and our
fake __KERNEL_CS
pushl 8(%esp)
popfl
# and then return, skipping __KERNEL_CS and %flasg
ret $8
which is smaller and simpler than (again) playing games with stack entries.
Linus
Powered by blists - more mailing lists