Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3789834imm; Tue, 11 Sep 2018 02:02:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYEQ8M16QtaZuYkXaxmXVdzPzOsIOOwr4nI4YIcgmAvb/vwYRN29vWtgJG7nRuhhYwQTspq X-Received: by 2002:a17:902:b702:: with SMTP id d2-v6mr26367275pls.12.1536656520847; Tue, 11 Sep 2018 02:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536656520; cv=none; d=google.com; s=arc-20160816; b=UNqy5aihFLpmV2aDRdnGyr77Fheqg6e1FhF4POfzxr85nYJBwxUBfn2nyF1z3rtrlr 8Sq0vMo1Z01hSUW/b/Z5OqmMzKW1qHjvdjjkibSmyodOLhHlaHYkRzBLp36g7ZSAboLF aan0OHntT+8hNk7JBLiBVBuiT5DFT3wtzTFG0nMlGw0MGeURtmSRkwXNzB2VZPxo/Bha pFVjeLNrKFEFdqHwVhiW/MtMHN+fRogEyOuu7uoPutCpfJqUxwMPJYIHo721+HUJkLNj hFYOrL1FMase1ctckz8ebLRiRGPhUFXc1vhRuM8xy15uRLID2Yq+Mbw/D+D7nfWAZEsT g+kw== 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 :references:in-reply-to:mime-version; bh=h4oJw+ynzQ8Zu/vSd4Kjy7FKhkwDad02lg5B8uodE3I=; b=ZscRzUyK/o8E92UVberLCubm7PoUw16CrZZcHcnTtK0i/lj3U7LHHQD4b6++/axxJO rXJ6KGztj7xpfV3RtStIkupjFT8XBMG0x2uWD/ZgDnvWR/2gese7886oFq5IZnkCyRtV HeyTgJwNSWgNCSgQHh//Y9kH0skIYOwmNNVSL7qbosf/c5bwtoRPaQngjzXKnGixGt5J RtBQO9m/nyzXNp2hZsthXmBVYyzUYt9BpHSHKFG+OT/dyZdwjaZI7nYXgyrx8o0n8NCO VWwZLBOMrHiOMzNQltwWMZfb+NVogz3/MKU5HG08GmjUL+1XrciFEqLURDMwtDr59/iF WeSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si19052568plk.379.2018.09.11.02.01.40; Tue, 11 Sep 2018 02:02:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbeIKN7u (ORCPT + 99 others); Tue, 11 Sep 2018 09:59:50 -0400 Received: from smtp.dei.uc.pt ([193.137.203.253]:54120 "EHLO smtp.dei.uc.pt" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbeIKN7u (ORCPT ); Tue, 11 Sep 2018 09:59:50 -0400 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (user=sneves mech=PLAIN bits=0) by smtp.dei.uc.pt (8.15.2/8.15.2) with ESMTPSA id w8B90lSL032577 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 11 Sep 2018 10:00:53 +0100 Received: by mail-ed1-f46.google.com with SMTP id f38-v6so18602032edd.8; Tue, 11 Sep 2018 02:00:53 -0700 (PDT) X-Gm-Message-State: APzg51CMG2lkDi/vhlL69/uHPh1ZS9ohnRskm0C+Cb09ollShlRN1O/P /mVbNPCN55lbGFIoFADTGeYa9AAKZm8PzBo9Ik0= X-Received: by 2002:a50:95a8:: with SMTP id w37-v6mr28236833eda.33.1536656447546; Tue, 11 Sep 2018 02:00:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:92c5:0:0:0:0:0 with HTTP; Tue, 11 Sep 2018 02:00:07 -0700 (PDT) In-Reply-To: References: <20180911010838.8818-1-Jason@zx2c4.com> <20180911010838.8818-6-Jason@zx2c4.com> From: Samuel Neves Date: Tue, 11 Sep 2018 10:00:07 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v3 05/17] zinc: ChaCha20 x86_64 implementation To: Thomas Gleixner Cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net, Greg Kroah-Hartman , Andy Lutomirski , Jean-Philippe Aumasson , Andy Polyakov , Ingo Molnar , "the arch/x86 maintainers" , Linux Crypto Mailing List Content-Type: text/plain; charset="UTF-8" X-FCTUC-DEI-SIC-MailScanner-Information: Please contact helpdesk@dei.uc.pt for more information X-FCTUC-DEI-SIC-MailScanner-ID: w8B90lSL032577 X-FCTUC-DEI-SIC-MailScanner: Found to be clean X-FCTUC-DEI-SIC-MailScanner-SpamCheck: not spam, SpamAssassin (cached, score=-60.1, required 3.252, autolearn=not spam, ALL_TRUSTED -10.00, BAYES_00 -0.10, L_SMTP_AUTH -50.00) X-FCTUC-DEI-SIC-MailScanner-From: sneves@dei.uc.pt X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 9:22 AM, Thomas Gleixner wrote: > On Mon, 10 Sep 2018, Jason A. Donenfeld wrote: >> lib/zinc/Makefile | 4 + >> lib/zinc/chacha20/chacha20-x86_64-glue.h | 102 + >> lib/zinc/chacha20/chacha20-x86_64.S | 2632 ++++++++++++++++++++++ > > Just a stupid question. What's the rationale of putting that into lib/zinc > instead of having it in arch/x86/crypto? > This is covered on the 02/17 commit message, whose relevant paragraph follows: > It also organizes the implementations in a simple, straight-forward, > and direct manner, making it enjoyable and intuitive to work on. > Rather than moving optimized assembly implementations into arch/, it > keeps them all together in lib/zinc/, making it simple and obvious to > compare and contrast what's happening. This is, notably, exactly what > the lib/raid6/ tree does, and that seems to work out rather well. It's > also the pattern of most successful crypto libraries. The architecture- > specific glue-code is made a part of each translation unit, rather than > being in a separate one, so that generic and architecture-optimized code > are combined at compile-time, and incompatibility branches compiled out by > the optimizer.