]> git.baikalelectronics.ru Git - kernel.git/commit
indirect call wrappers: helpers to speed-up indirect calls of builtin
authorPaolo Abeni <pabeni@redhat.com>
Fri, 14 Dec 2018 10:51:57 +0000 (11:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Dec 2018 21:23:02 +0000 (13:23 -0800)
commit283c16a2dfd332bf5610c874f7b9f9c8b601ce53
tree2769165645fb361731abd6c7c227b46f691cf9c7
parent35e07d23473972b8876f98bcfc631ebcf779e870
indirect call wrappers: helpers to speed-up indirect calls of builtin

This header define a bunch of helpers that allow avoiding the
retpoline overhead when calling builtin functions via function pointers.
It boils down to explicitly comparing the function pointers to
known builtin functions and eventually invoke directly the latter.

The macros defined here implement the boilerplate for the above schema
and will be used by the next patches.

rfc -> v1:
 - use branch prediction hint, as suggested by Eric
v1  -> v2:
 - list explicitly the builtin function names in INDIRECT_CALL_*(),
   as suggested by Ed Cree

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/indirect_call_wrapper.h [new file with mode: 0644]