[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190501190348.GT7905@worktop.programming.kicks-ass.net>
Date: Wed, 1 May 2019 21:03:48 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>,
Nicolai Stange <nstange@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
the arch/x86 maintainers <x86@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Mimi Zohar <zohar@...ux.ibm.com>,
Juergen Gross <jgross@...e.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nayna Jain <nayna@...ux.ibm.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Joerg Roedel <jroedel@...e.de>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
live-patching@...r.kernel.org,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>
Subject: Re: [RFC][PATCH] ftrace/x86: Emulate call function while updating in
breakpoint handler
On Wed, May 01, 2019 at 02:58:24PM -0400, Steven Rostedt wrote:
> > + if (ftrace_location(ip)) {
> > + int3_emulate_call(regs, ftrace_update_func_call);
>
> Should be:
>
> int3_emulate_call(regs, (unsigned long)ftrace_regs_caller);
Ah, I lost the plot a little there.
> > + return 1;
> > + } else if (is_ftrace_caller(ip)) {
> > + if (!ftrace_update_func_call) {
> > + int3_emulate_jmp(regs, regs->ip - INT3_INSN_SIZE + CALL_INSN_SIZE);
>
> I see what you did here, but I think:
>
> int3_emulate_jmp(regs, ip + CALL_INSN_SIZE);
>
> looks better. But that said, we could in the beginning do:
>
> ip = regs->ip - INT3_INSN_SIZE;
>
> instead of
>
> ip = regs->ip - 1;
>
> I made these updates and posted them to Linus.
I was actually considering:
static inline void int3_emulate_nop(struct pt_regs *regs, unsigned long size)
{
int3_emulate_jmp(regs, regs->ip - INT3_INSN_SIZE + size);
}
And then the above becomes:
int3_emulate_nop(regs, CALL_INSN_SIZE);
Hmm?
Powered by blists - more mailing lists