Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp996508ybp; Fri, 4 Oct 2019 08:06:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwRLxKd8VzVoyqlRX7P3FIZAQqcXBeZKIzsmSRJM8Okb6IRQ/Bv2fDoISZ6aCInfPeQncf X-Received: by 2002:a5d:5111:: with SMTP id s17mr11098745wrt.59.1570201608318; Fri, 04 Oct 2019 08:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570201608; cv=none; d=google.com; s=arc-20160816; b=CH1r67GC4zRO+yMLMAdA5hTNLuaXpZQHgFptLJARz86ELQfFablySRZutV4o40zCkC KvwnW0iHEo7/927nL1IxMuYpeKQMoMLNfgb4iHYsvJBKS3duMIpRqj74ZO5F+Td6NJMx O8Ik44MB8ctb1Bku3/VLqADD+LZJrIqtRQQEyl/TVClHvPKqhNpguXw8la//fxi2XxFc 2rq1t1hPquYOlL9bdQRfiJvIXn1zmwPToUL6proF7m+vYOKXtp346F7bfYncmqynoO1l ynpZ6wygmeHmpiTx2WXJ2724bicSNd0loVg6vU+iUgyzyhfhmJDiYKWACQ+9UWXbPP6j SDTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ekjrUdXZysZBgjOdshj5/zqIHgmJSBhb5PKNjrF4mcU=; b=cWxqbrJic3I71rN7+W0iYQyiy4wpASswTeXDa43FT8nWssnBsmvQjDMiax6PoGEv/F pbsRa7NPY2reB68e+PlOA9UnRtmJjGt9ENcsMVA5tVNUHjp1oP3Ys4ZVknvRgSPqgxgJ TmCm4OUahiqbctElHntzIzMH3gI6PR2HXBHZZp6sZcL28K3u30+9aZO/+HmDUdDF7Kz/ Iajbb2DNeP2FWTqfWL6ACkapYcBtgVbRowxR/hrqC5tT+wVIPW5r0lfacFFDJk5zLUq5 kszB3wY1GX/ALg+sVgDuX0fEqNPFj5F8yabw3ozia5uZeAShohZkl4a5l+Oq7D0av+M3 BJOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k6D8p7QE; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14si3616674edf.102.2019.10.04.08.06.21; Fri, 04 Oct 2019 08:06:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@linaro.org header.s=google header.b=k6D8p7QE; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389491AbfJDPFW (ORCPT + 99 others); Fri, 4 Oct 2019 11:05:22 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40599 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388802AbfJDPFV (ORCPT ); Fri, 4 Oct 2019 11:05:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id l3so7627960wru.7 for ; Fri, 04 Oct 2019 08:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ekjrUdXZysZBgjOdshj5/zqIHgmJSBhb5PKNjrF4mcU=; b=k6D8p7QE0Qz1Im4fttY4SppkXF0pEgTEFKXmDBOf1ouFZ9UEI990gVtzCG7agWWFkc j00e5EXS+19ZQzVJ97ODFkZGaDppk0sc0Ywf0/Kq6F+YnwDlstPgs5eTWG0udcYNsSaz KxlRXlNFikVHFRtZn8cTrIF9kZ3GDD9ZOymVeowVJANAu3IIvOs6Kw9LzHGuOSo6dpHm NJim1Ztmo+AVF61eqJEcRCQuqn836Hqts1qb52UbfCDphJRh72rHiM2JJF6l2Pl5+Fkp Yucv/2ulnWxFPrMK+8Gmhm0iX0l3yrou/WAvJ5CnmbY8NGUp+L6Yg1psXPIW53nT1l8t 5zag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ekjrUdXZysZBgjOdshj5/zqIHgmJSBhb5PKNjrF4mcU=; b=EKvC1OB108wFCtOX6n+AefqVFfJoBpz7lfzpRMMT42lZefu6Ue5fmG3kEY1OEW+ct1 Tm+1PxinB2zeGipbgVMz0xY63rZoreyiZ9rb9aTEqPT3cKcnNl7JtW3D0tuzubD+Z2Pc VY4EUmboI7mzKUm2e1iIk+Sr7s8xO65O/mEsG2hNTdTCL341ytqyimm5tUA4iqNNjXFJ kF4nPuNZ3XjrlG7n4OJpjnM1S70lWpq0nSQMVwP5ltPo81QEUPyQVeqOYsYLeGF9nQM4 VFmFHkTc1xQ7ajLUqCfgwKKOYKydxfGomDm9STUz5eAQztDargVs0dV25vcMhXelvCdf YNwQ== X-Gm-Message-State: APjAAAUnAqdmah0kOIutpyqZuNVRfuddnbHkNdhtvyBY8CcwCU/mJ/MI W9tUJxfwl8v03+Hosfqxb9x5ywWkev4pUhg7KlFwUg== X-Received: by 2002:a5d:6a81:: with SMTP id s1mr12637760wru.246.1570201517913; Fri, 04 Oct 2019 08:05:17 -0700 (PDT) MIME-Version: 1.0 References: <20191002141713.31189-1-ard.biesheuvel@linaro.org> <20191002141713.31189-6-ard.biesheuvel@linaro.org> <20191004134644.GE112631@zx2c4.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 4 Oct 2019 17:05:05 +0200 Message-ID: Subject: Re: [PATCH v2 05/20] crypto: mips/chacha - import accelerated 32r2 code from Zinc To: "Jason A. Donenfeld" Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , David Miller , Greg KH , Linus Torvalds , Samuel Neves , Dan Carpenter , Arnd Bergmann , Eric Biggers , Andy Lutomirski , Will Deacon , Marc Zyngier , Catalin Marinas , Martin Willi , Peter Zijlstra , Josh Poimboeuf , =?UTF-8?Q?Ren=C3=A9_van_Dorst?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 4 Oct 2019 at 16:59, Jason A. Donenfeld wrote: > > On Fri, Oct 4, 2019 at 4:44 PM Ard Biesheuvel = wrote: > > The round count is passed via the fifth function parameter, so it is > > already on the stack. Reloading it for every block doesn't sound like > > a huge deal to me. > > Please benchmark it to indicate that, if it really isn't a big deal. I > recall finding that memory accesses on common mips32r2 commodity > router hardware was extremely inefficient. The whole thing is designed > to minimize memory accesses, which are the primary bottleneck on that > platform. > Reloading a single word from the stack each time we load, xor and store 64 bytes of data from/to memory is highly unlikely to be noticeable. > Seems like this thing might be best deferred for after this all lands. > IOW, let's get this in with the 20 round original now, and later you > can submit a change for the 12 round and Ren=C3=A9 and I can spend time > dusting off our test rigs and seeing which strategy works best. I very > nearly tossed out a bunch of old router hardware last night when > cleaning up. Glad I saved it! I don't agree but I don't care deeply enough to argue about it :-)