Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4702387pxb; Tue, 28 Sep 2021 02:01:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBWACbaApuy7wmMNbtFPH0zFOhu9jLYcOinlciBW8MsB84Wxb+aiIp5RQbOEKQ6q1Wmeb3 X-Received: by 2002:a17:906:1341:: with SMTP id x1mr5274008ejb.277.1632819706863; Tue, 28 Sep 2021 02:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632819706; cv=none; d=google.com; s=arc-20160816; b=pHg7yHD71VqJe/enXtf/+/pVJwYGUcrdnLSEy+fdjP8ziC7/Wsro11+P9SXef3DL7l fald8dh7yLjCpSwGks/HrfLA0OR/752dhEwQueaTKPIlZrDaWQOfi17FT+rsB6PRU+wJ cQ8Hr7/++TbSla22+07olF8P9OUHNgpHel4sJuAPJ87w4b+cQCMic+cOSMo9X4UBt4jp WtJs3EsQ1kzhddPJNgZe7hZfuqFTqIgm+rrvwecXW22w0MB5p53giYRyoKnP1lj3AZT9 ltaMYTEn4EQygccbZGOFTsj08WT3qJCUM0XEEeFJNZ+dOSYxv+TYkXVrrd/rUO7nmlPA 2BQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=9+l797S525fTAhFQdHpd5nDB8FSDtdvxnqZ0qZ3uADs=; b=zrncrrhzeEPSWUzZC/5+JZFEVQWVYLfoRxKUqijPfevWTRKZHP8zBnuo40ldBYZ9To EzkURrsZu83S9IiMIXcY3EN666649upmUgW/12p+Jk+QfuWY5GxnhTaoKgKDASqM8044 R9MTwxfnpCoH05tcrC+YWEUhqEF7zo6V4UI0aidrxnT18FKIEqnq8EqlfcXGsaHjrHPx 4PsMHtfiU8e98xAeSRV1SUJyDNBM6ehoqZn9UtddCQ7akhX06hvbklrdox/VAj65pusj CicGI9ZIXrhZ0XDLOrfpR0fw0ZebYWyEPSGtprTdjkJf1YFV0MtZEe/sigQO6cqm65oi Va+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si21723368eja.426.2021.09.28.02.01.14; Tue, 28 Sep 2021 02:01:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239657AbhI1JCd convert rfc822-to-8bit (ORCPT + 99 others); Tue, 28 Sep 2021 05:02:33 -0400 Received: from mail-vs1-f41.google.com ([209.85.217.41]:42737 "EHLO mail-vs1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239254AbhI1JCd (ORCPT ); Tue, 28 Sep 2021 05:02:33 -0400 Received: by mail-vs1-f41.google.com with SMTP id z62so21220482vsz.9; Tue, 28 Sep 2021 02:00:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2LPnGpLh0Z/OFWhJ3bW6nNOAP+i5ywRc/ibvIJ8V0ZU=; b=ahdeUN3md/jKPjRspN5EIUzmln2WJmZ6FR/+5kqTRUNsvnfQPg/pNsXeO5Y5bbF1QF Uans8tcpacTgMKAJUoh/9D/7H8kOwTlelfXceb4JO6u5/UMyR5esuUWpHLEyR/swevrj On7Pvtbu31/0X0L2SUxPYqG+Kpx/A1xW07UT3fMR2TAIceVJVJAC0tl7Zi+RfIiNH8S8 LWUwhA3CwW5xv33AWar+B/4o2rEcZCx9vYF1RSM/g4n27rwCc9D0JrHr1senncdtf/N0 Yj1jum8BLPZX/EC6lXWv6hS4A5IuSLgzRUJBeFaowbfYhfc/J9h36T6gsoUPR4n+OOsr +IRw== X-Gm-Message-State: AOAM531bDE+Ts7qNwEA1+1Lm8wGHekoXU6eDKxwUJrWTNQZGBRNFNDJ0 Wdgy4wb9K+/V6pLzllqYcP0KEp0PQSHfl0LOagCH5A3ANic= X-Received: by 2002:a67:cc1c:: with SMTP id q28mr3526995vsl.37.1632819653399; Tue, 28 Sep 2021 02:00:53 -0700 (PDT) MIME-Version: 1.0 References: <20210921213930.10366-1-linkmauve@linkmauve.fr> <20210921213930.10366-2-linkmauve@linkmauve.fr> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 28 Sep 2021 11:00:41 +0200 Message-ID: Subject: Re: [PATCH 1/4] crypto: nintendo-aes - add a new AES driver To: Joel Stanley Cc: Emmanuel Gil Peyrot , Linux Crypto Mailing List , devicetree , Herbert Xu , Linux Kernel Mailing List , Rob Herring , Paul Mackerras , Ash Logan , linuxppc-dev , "David S. Miller" , =?UTF-8?Q?Jonathan_Neusch=C3=A4fer?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Sep 22, 2021 at 4:12 AM Joel Stanley wrote: > On Tue, 21 Sept 2021 at 21:47, Emmanuel Gil Peyrot > wrote: > > > > This engine implements AES in CBC mode, using 128-bit keys only. It is > > present on both the Wii and the Wii U, and is apparently identical in > > both consoles. > > > > The hardware is capable of firing an interrupt when the operation is > > done, but this driver currently uses a busy loop, I’m not too sure > > whether it would be preferable to switch, nor how to achieve that. > > > > It also supports a mode where no operation is done, and thus could be > > used as a DMA copy engine, but I don’t know how to expose that to the > > kernel or whether it would even be useful. > > > > In my testing, on a Wii U, this driver reaches 80.7 MiB/s, while the > > aes-generic driver only reaches 30.9 MiB/s, so it is a quite welcome > > speedup. > > > > This driver was written based on reversed documentation, see: > > https://wiibrew.org/wiki/Hardware/AES > > > > Signed-off-by: Emmanuel Gil Peyrot > > Tested-by: Emmanuel Gil Peyrot # on Wii U > > --- > > drivers/crypto/Kconfig | 11 ++ > > drivers/crypto/Makefile | 1 + > > drivers/crypto/nintendo-aes.c | 273 ++++++++++++++++++++++++++++++++++ > > 3 files changed, 285 insertions(+) > > create mode 100644 drivers/crypto/nintendo-aes.c > > > > diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig > > index 9a4c275a1335..adc94ad7462d 100644 > > --- a/drivers/crypto/Kconfig > > +++ b/drivers/crypto/Kconfig > > @@ -871,4 +871,15 @@ config CRYPTO_DEV_SA2UL > > > > source "drivers/crypto/keembay/Kconfig" > > > > +config CRYPTO_DEV_NINTENDO > > + tristate "Support for the Nintendo Wii U AES engine" > > + depends on WII || WIIU || COMPILE_TEST > > This current seteup will allow the driver to be compile tested for > non-powerpc, which will fail on the dcbf instructions. > > Perhaps use this instead: > > depends on WII || WIIU || (COMPILE_TEST && PPC) Or: depends on PPC depends on WII || WIIU || COMPILE_TEST to distinguish between hard and soft dependencies. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds