lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2020-03-30 22:31    [W:0.286 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site