Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers
From: Jason A. Donenfeld
Date: Fri Oct 05 2018 - 14:28:41 EST
Hey Andy,
On Fri, Oct 5, 2018 at 7:44 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
> I *think* the only change to Zinc per se would be that the calls like
> chacha20_simd() would be static calls or patchable functions or
> whatever we want to call them. And there could be a debugfs to
> override the default selection.
Yea, right, exactly. It turns out this is really easy to do with the
way it's structured now. I'd actually experimented considerably with
using the static keys a while back, but couldn't find any performance
difference on any platform at all (four ARM microarchitectures, three
MIPS, various random intel, an old powerpc), so went with the simplest
solution. But we can certainly play with more elaborate patching
mechanisms later on and see how those turn out. Also, even with the
simple bools as we have now, it's quite easy to make all the
parameters toggle-able.
> Ard, I don't think that sticking this in udev rules makes sense. The
> kernel has bascially complete information as to what the right choice
> is, and that will change over time as the implementation gets tuned,
> and the udev rules will never get updated in sync.
Yes, I agree with this.
Jason