[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190430150012.58ed382b@gandalf.local.home>
Date: Tue, 30 Apr 2019 15:00:12 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.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 Tue, 30 Apr 2019 11:33:21 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Tue, Apr 30, 2019 at 10:49 AM Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > +
> > +asm(
> > + ".text\n"
> > +
> > + /* Trampoline for function update with interrupts enabled */
> > + ".global ftrace_emulate_call_irqoff\n"
> > + ".type ftrace_emulate_call_irqoff, @function\n"
> > + "ftrace_emulate_call_irqoff:\n\t"
> > + "push %gs:ftrace_bp_call_return\n\t"
>
> Well, as mentioned in my original suggestion, this won't work on
> 32-bit, or on UP. They have different models for per-cpu data (32-bti
> uses %fs, and UP doesn't use a segment override at all).
Ah, yeah, I forgot about 32-bit. I could easily make this use fs as
well, and for UP, just use a static variable.
>
> Maybe we just don't care about UP at all for this code, of course.
>
> And maybe we can make the decision to also make 32-bit just not use
> this either - so maybe the code is ok per se, just needs to make sure
> it never triggers for the cases that it's not written for..
>
> > + "ftrace_emulate_call_update_irqoff:\n\t"
> > + "push %gs:ftrace_bp_call_return\n\t"
> > + "sti\n\t"
> > + "jmp *ftrace_update_func_call\n"
>
> .. and this should then use the "push push sti ret" model instead.
>
> Plus get updated for objtool complaints.
Yeah, I see that now. Somehow it disappeared when I looked for it after
making some other changes. I can update it.
>
> Anyway, since Andy really likes the entry code change, can we have
> that patch in parallel and judge the difference that way? Iirc, that
> was x86-64 specific too.
Note, I don't think live kernel patching supports 32 bit anyway, so
that may not be an issue.
Josh,
When you come back to the office, can you look into that method?
-- Steve
Powered by blists - more mailing lists