[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200330202927.GF20760@hirez.programming.kicks-ass.net>
Date: Mon, 30 Mar 2020 22:29:27 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: tglx@...utronix.de, linux-kernel@...r.kernel.org, x86@...nel.org,
mhiramat@...nel.org, mbenes@...e.cz,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH v4 01/13] objtool: Remove CFI save/restore special case
On Mon, Mar 30, 2020 at 10:02:54PM +0200, Peter Zijlstra wrote:
> On Mon, Mar 30, 2020 at 02:02:05PM -0500, Josh Poimboeuf wrote:
> > However sync_core() and ftrace_regs_caller() are very different from
> > each other and I find the RET_TAIL hint usage to be extremely confusing.
>
> I was going with the pattern:
>
> push target
> ret
>
> which is an indirect tail-call that doesn't need a register. We use it
> in various places. We use it here exactly because it preserves all
> registers, but we use it in function-graph tracer and retprobes to
> insert the return handler. But also in retpoline, because it uses the
> return stack predictor, which by happy accident isn't the indirect
> branch predictor.
>
> > For example, IRETQ isn't even a tail cail.
>
> It's the same indirect call, except with a bigger frame ;-)
>
> push # ss
> push # rsp
> push # flags
> push # cs
> push # ip
> iret
>
> > And the need for the hint to come *before* the insn which changes the
> > state is different from the other hints.
>
> makes sense to me... but yah.
Also, naturally, there are no instructions after RET to stick the
annotation to.
Powered by blists - more mailing lists