3 ms·
There has recently been some work in the Linux kernel to implement some infrastructure to allow hot indirections through function pointers to be replaced by dyn
by caf 8y ago
There has recently been some work in the Linux kernel to implement some infrastructure to allow hot indirections through function pointers to be replaced by dynamically rewritten branches - this is entirely done for performance reasons, so that's at least a data point in favour of the "rewrite the jump target" option.
(This is particularly motivated by the fact that Spectre mitigation requires ordinary indirect jumps in the kernel to use a "retpoline", which prevents the processor speculating the jump target but is very slow - are you using retpolines for your indirect jumps?)
The most recent "static calls" patch set thread: https://lkml.org/lkml/2019/1/9/1112 https://lkml.org/lkml/2019/1/9/1112