Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp986619ybp; Fri, 4 Oct 2019 07:59:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgzVlNHxurpRDxCAPj6rh+mi19S41aDwVaQp8ruqW9Jl6rtANL0xLpEkJlE3btJsQi0D69 X-Received: by 2002:aa7:dcd7:: with SMTP id w23mr15443286edu.170.1570201190291; Fri, 04 Oct 2019 07:59:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570201190; cv=none; d=google.com; s=arc-20160816; b=x1kz9nnMBGiENfHClV8pHFds8bmg6ffBxNGzpHwZvyYsMA61z7GXXwzbyDMG/QvAUu K3TbIH3mhdS91HO3xj2qn0JoHFblziQ1PKIhAjl8BGdS6RJo7Hy4TKK7s5xwtGovEbOl rCjwZyC+pPP/SwLlAhBN6mUJVTctB21vEe8dFOi2K2CxzwJ/MFegMlldMgoXgK0uMFsn BqiJFGHBPhji0SOYYZdLNkjbRBHX5w+GnvO4i+65oDBveiWjs4PNv0maa2LwjGL2U75e 2XjZ8gGKnaDUid7hpd1OkQbhsR0GVLtZaMKLbqZqir0wfvNthmLjmGdvoIPxeY78rb0h yajQ== 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=OrxAb1o5ak/WrbIRzf/7IRB4bL+p/kGYZjvHQ9n7jdI=; b=qU1ej5VAgKl0Hv4wcTluMzn6v3NiU0PBZEaSTw40cbY06T0q2zKPKNbXk7XYnlFYrm lrWdmHB904w6TgGJioGqGW/zOVsWBdL5PSz703g/cmZXSM+18ghFl+QZ1zAX9E6RCLMz O/NHJ0/qAYMrBnG9rjROyFaXiO9IId2jLqNKoo5DhvGfTu067GJFY08ZK3max+VtDynq 5oEm19F40aQmKgQ6D/waNinYhwPCXb0IvMGw/fj3K1kJU+zX5tAvOml5dGdhT659XG1G f3FZRh8KnvUf1ILIVVMDsWsNOe076Mde+kDRS1B6xioVQGvUmbw37U+PZ5LYtRazUb17 NA8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=3SRA1hxa; 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=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si3576122eds.179.2019.10.04.07.59.25; Fri, 04 Oct 2019 07:59:50 -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=@zx2c4.com header.s=mail header.b=3SRA1hxa; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389556AbfJDO7Q (ORCPT + 99 others); Fri, 4 Oct 2019 10:59:16 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:54461 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389547AbfJDO7P (ORCPT ); Fri, 4 Oct 2019 10:59:15 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 2fb4cf1e for ; Fri, 4 Oct 2019 14:12:20 +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:content-transfer-encoding; s=mail; bh=eBPyNtJsbfkG C241+EIvbNMYYDg=; b=3SRA1hxaTJbwQOVz/in5mj3w6FJN1H24Xsk6ttZPw/O8 LZGiNPRDO6zirVpfnZ9fOIYF7xj4JqxTEkpt582x1EOUJ5fkg07+a9EhA1CkZ+rb NyM/JcAZaM4BovY6i36/18OC0u4EhnBtGqzpqfRDWW/hNLDYZOyXMNwJtDN1lpBQ koWSxT2wcpR3/XlnP6yCgbPLufMkvx4fWgHM6TEwnXHCK0EHa+31e1tb3AAhJzx6 hs/z6pbgz4UpCzUT2lFTUcTpF8ia+5g6CLmKwiEu7CRDTJH5LuemkjWRvTYUQJlh 12e1RQcnqMPzy0e+rZ6W1X3tA1nWl/aBeeKdO1QDNw== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id dec44d92 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Fri, 4 Oct 2019 14:12:18 +0000 (UTC) Received: by mail-ot1-f44.google.com with SMTP id z6so5555294otb.2 for ; Fri, 04 Oct 2019 07:59:13 -0700 (PDT) X-Gm-Message-State: APjAAAVogfHHbjPtOPyo0obb50dtfsXJY2839Ns3fGxWPm/ifO3YgwTA DROvVohQ0QCiyxf8Q4cxPV8mqTEtZ1fFqf9BxLY= X-Received: by 2002:a9d:ec2:: with SMTP id 60mr11399099otj.369.1570201151885; Fri, 04 Oct 2019 07:59:11 -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: "Jason A. Donenfeld" Date: Fri, 4 Oct 2019 16:59:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 05/20] crypto: mips/chacha - import accelerated 32r2 code from Zinc To: Ard Biesheuvel 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, Oct 4, 2019 at 4:44 PM Ard Biesheuvel w= rote: > 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. 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!