From: "Jason A. Donenfeld" Subject: Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers Date: Fri, 5 Oct 2018 20:28:23 +0200 Message-ID: References: <20181005081333.15018-1-ard.biesheuvel@linaro.org> <20181005081333.15018-2-ard.biesheuvel@linaro.org> <20181005141433.GS19272@hirez.programming.kicks-ass.net> <9E0E08C8-0DFC-4E50-A4FA-73208835EF9E@amacapital.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Ard Biesheuvel , Peter Zijlstra , LKML , Eric Biggers , Samuel Neves , Arnd Bergmann , Herbert Xu , David Miller , Catalin Marinas , Will Deacon , benh@kernel.crashing.org, paulus@samba.org, Michael Ellerman , Thomas Gleixner , mingo@redhat.com, Kees Cook , "Martin K. Petersen" , Greg Kroah-Hartman , Andrew Morton , richard@nod.at, Linux Crypto Mailing List , l To: Andrew Lutomirski Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org Hey Andy, On Fri, Oct 5, 2018 at 7:44 PM Andy Lutomirski 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