Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp772031imm; Fri, 5 Oct 2018 11:29:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV63NXbXOaXjD8T4rQSPzYTVAoPP4GngzPQkNsWvuNQF6KbSDzgTqNujF0Vuaq4sEPy8l4BQq X-Received: by 2002:a62:475c:: with SMTP id u89-v6mr1213201pfa.212.1538764150333; Fri, 05 Oct 2018 11:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538764150; cv=none; d=google.com; s=arc-20160816; b=UfqwkRqGbVO+SIlmHuSwbqx+c3iuLFTxldqd2sVpMTyMLDu/6w9zd0Jy54MlC2Vr+a AYooIz4ByUeO1EH33wjWQUKSO758bwoOnPx6vt8Z/1QZqQ6Q/JLVbQw8FNoPF3oGOqzi 8pBL9ueAUafdngDt9PBsQZaY0c9O+RExQNW5Q+jrddXQUcUeiBgD5hQzSUm+gBakmg+D BT1ChVPPVl1ZcJ7UCkN4r0de37zDZvtnNQrVrSKM5dSThgg7HbkBCDOOAnUbE6v+71A5 i+OzG9VdkiPegj7dEA9+6bP5AQtER6kqpbZcwRRYoQTgiWSrx5333Lgh/CkAHf5YVPCy 5M/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TV4zARB3oMaWWS+rk+wUzNkp0FTNBqPRFFJHcaMglC4=; b=NosQ/7qBTFkHeMyNRMMk9GaE6R1s9o73ybL/OGg4ZxXzqZGlsnAJsOytxyS2+of9+a sY/UfT7Yn61FtZHGeI8FtG+hXdDZ9yTS2m4hu3nSOoYxBtAGvq1Y/EFZS61ZIXj3pjf5 11a03N9xBA6fPBRa6+LrKLE3/tC0es0hsSYGC6y4NbcFBVbrc0y73ct17lluj6ppGBBs eZ2tjpA4f/tD+IYGi3wqMiWOkxBLUvk5kA+d+B1emr53hN1S+2XjbrY2h59oDaMs8FAI 21xoQXZMWEn2B+fSV/NlkWDzhDy4WuX4KeGR1wzbZzB45vPh7vFNNmnDNkRCCx3GTwY0 Lzvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=ugjszM4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m22-v6si8994686pgj.583.2018.10.05.11.28.54; Fri, 05 Oct 2018 11:29:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=ugjszM4i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728661AbeJFB2d (ORCPT + 99 others); Fri, 5 Oct 2018 21:28:33 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:58929 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbeJFB2d (ORCPT ); Fri, 5 Oct 2018 21:28:33 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id b259e641; Fri, 5 Oct 2018 18:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=Yr6FhUAX3hdxgAc9gx3UpICGflk=; b=ugjszM 4i9cFKI8xwsjwj3DyW4iSgnSDA3pKaatZQZT2Q92hOQlFxpR0pvpHT0JCX7chaHQ N39LZuasqYx6nVWq/lSzosdWxURfHC1tAsLKlZli4tg2Y5EVooTJCMtcvvH7SeAn LhEpWIx+IJUBld6ChT8nxmS8lD3DOtl3SAlcTuzTGPmhbIZvupmEZDrmuZLx5QpJ v3Ns0vTSjNFTcz16VC6X8RYmOp5Pmx3w+VraUe31oX6kBBmY3FW6OfhQWMRXWSdh XctnESSltkTsG2O/xnJKztfIMCpBW1r2FvsG0oEY7je9c9Gh2ZVShHa3GmPWrHa5 +R72GsKvncZPHGUA== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ffbdf639 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Fri, 5 Oct 2018 18:28:10 +0000 (UTC) Received: by mail-ot1-f53.google.com with SMTP id o13-v6so13616810otl.4; Fri, 05 Oct 2018 11:28:36 -0700 (PDT) X-Gm-Message-State: ABuFfohoNZb6PNcmKaNYv/gmq6lmvIjQpqJsJVOx2xxin9ROi5MWmeee kSGxLdR15DXpU0R4hTn4QU2qhnzLs2M+FkliM0E= X-Received: by 2002:a9d:2992:: with SMTP id n18mr881570otb.54.1538764115077; Fri, 05 Oct 2018 11:28:35 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: "Jason A. Donenfeld" Date: Fri, 5 Oct 2018 20:28:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers To: Andrew Lutomirski 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 , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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