Messages in this thread | | | From | Linus Torvalds <> | Date | Wed, 25 Mar 2020 13:52:00 -0700 | Subject | Re: [RESEND][PATCH v3 14/17] static_call: Add static_cond_call() |
| |
On Wed, Mar 25, 2020 at 12:35 PM <hpa@zytor.com> wrote: > > "movl $0,%eax" is five bytes, the same length as a call. Doesn't work for a tailcall, still, although if the sequence: > > jmp tailcall > retq > > ... can be generated at the tailcall site then the jmp can get patched out.
No, the problem is literally that the whole approach depends on the compiler just generating normal code for the static calls.
And the tailcall is the only interesting case. The normal call thing can be trivially just a single instruction (a mov like you say, but also easily just a xor padded with prefixes).
Linus
| |