Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1976030rwb; Wed, 5 Oct 2022 07:28:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ciW89gia/4nHI5XuEG4qi72aWvlRlxykgvljYieui7fpOMPeoKvwgUoGqrpkySGXHCb1q X-Received: by 2002:a17:90b:164b:b0:202:d347:2512 with SMTP id il11-20020a17090b164b00b00202d3472512mr84686pjb.185.1664980090813; Wed, 05 Oct 2022 07:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664980090; cv=none; d=google.com; s=arc-20160816; b=0TAfF8r+MI2xtFsSXY/aHoaxwzpHoa84eGERKcJorTW/ba2Qo4cHMpc1WrgP1HEzIZ /lI3togbsQuzeCLaas6Cz6KsXwhGwdqxDWpGBdLZPWJQddANRvzWqUDBDnZDJpQdkpv4 sRHrZeNmh+pTdve7Xkun3ddyFJO+Jh5SNAb31iRxI6OJSryrG1mCDrT/aXgJj+ooFOl0 YfEprfiJJTMceAL4fdHtDVtLzjaIktFdDa5n7BA42F8iccB7L//5WjmGiiqyDwsXEzxW xPRUj20r1//IvEA2ZbbvewUDWDPghvjpPY9AUQk5QbUJlokWD79JiJHK6lWTCxQ690ln /lfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=3JSB4DnxCSvnV/yiR2JsekRvdmGAQct2FIz6pwWX1EY=; b=jIr0KTjW01tOEO8ltbX937O0QGVU87aXXYbR3c07EATZd62FmI6BloitZ+vRtVmp6W NXL0RzmektW8pLqToxvFduphQ0B8127Z/3cTnaSMTnUI+a61BobwV4V2MBBp7oG3yxI6 DSHgtHHOB0A5slcmKB+0taU83yR5pR6S8nBpBxDVo892eNXeZsHJcB+voW/u+lDcuUBO aG4iqiF2JVHWrkVuKJOrasJEEYUlI5yOO492eO1tguY74qxdbYt/BqGVFh3o0mKZfNBp 0vl/Gn+ijPGuj7r3PIJd1byY2vktn4DGyx5KP8k3Nk3rYYZMSKPhI6cV/XRUFV9a+gg8 pBGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a17090ab30e00b001fab0d18bcasi1932992pjr.66.2022.10.05.07.27.48; Wed, 05 Oct 2022 07:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229379AbiJEOYn (ORCPT + 99 others); Wed, 5 Oct 2022 10:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiJEOYm (ORCPT ); Wed, 5 Oct 2022 10:24:42 -0400 X-Greylist: delayed 401 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 05 Oct 2022 07:24:40 PDT Received: from mail.sf-mail.de (mail.sf-mail.de [IPv6:2a01:4f8:1c17:6fae:616d:6c69:616d:6c69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78D165E9 for ; Wed, 5 Oct 2022 07:24:40 -0700 (PDT) Received: (qmail 17739 invoked from network); 5 Oct 2022 14:17:57 -0000 Received: from p200300cf070f090076d435fffeb7be92.dip0.t-ipconnect.de ([2003:cf:70f:900:76d4:35ff:feb7:be92]:41786 HELO eto.sf-tec.de) (auth=eike@sf-mail.de) by mail.sf-mail.de (Qsmtpd 0.38dev) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPSA for ; Wed, 05 Oct 2022 16:17:57 +0200 From: Rolf Eike Beer To: sparclinux@vger.kernel.org Cc: linux-crypto@vger.kernel.org Subject: Issues with hw crypto and random support on Niagara2 Date: Wed, 05 Oct 2022 16:17:45 +0200 Message-ID: <3804667.3oa1dkRz9v@eto.sf-tec.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2108249.AKfn3jg4vr"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org --nextPart2108249.AKfn3jg4vr Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Rolf Eike Beer To: sparclinux@vger.kernel.org Cc: linux-crypto@vger.kernel.org Subject: Issues with hw crypto and random support on Niagara2 Date: Wed, 05 Oct 2022 16:17:45 +0200 Message-ID: <3804667.3oa1dkRz9v@eto.sf-tec.de> MIME-Version: 1.0 [Resend with CC linux-crypto] I recently upgraded my Sun T5120 the kernel to 5.19.12. The first thing I noticed afterwards was that the boot took nearly one hour and spewed lots of warnings about crng_init=0. As a workaround I did that: # grep -n quality /usr/src/linux/drivers/char/hw_random/n2-drv.c 770: np->hwrng.quality = 5; This has solved the issue for me, boot is now down to ~2min again. I wonder if I'm missing something obvious like another driver that I should activate? Then I noticed that the hw crypto support from drivers/crypto/n2_core.c fails to load with -EINVAL. From looking at the code I think this is because statesize is not set for the hash algorithms, so registering the first one (md5) fails and nothing else is tried. I then set NUM_HASH_TMPLS to 0 so they were never attempted, which resulted in the second loop succeeding: [ 40.561230] n2_crypto: n2_crypto.c:v0.2 (July 28, 2011) [ 40.561361] n2_crypto: Found N2CP at /virtual-devices@100/n2cp@7 [ 40.561506] n2_crypto: Registered NCS HVAPI version 2.0 [ 40.562493] n2_crypto: ecb(des) alg registered [ 40.562567] n2_crypto: cbc(des) alg registered [ 40.562687] n2_crypto: cfb(des) alg registered [ 40.562760] n2_crypto: ecb(des3_ede) alg registered [ 40.562833] n2_crypto: cbc(des3_ede) alg registered [ 40.562906] n2_crypto: cfb(des3_ede) alg registered [ 40.563007] n2_crypto: ecb(aes) alg registered [ 40.563084] n2_crypto: cbc(aes) alg registered [ 40.563156] n2_crypto: ctr(aes) alg registered [ 40.563890] n2_crypto: Found NCP at /virtual-devices@100/ncp@6 Maybe someone with the knowledge about the right statesize could send a patch? I'm open for testing. This is probably broken for a very long time, i.e. 8996eafdcbad149ac0f772fb1649fbb75c482a6a (kernel v4.3). Greetings, Eike --nextPart2108249.AKfn3jg4vr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSaYVDeqwKa3fTXNeNcpIk+abn8TgUCYz2SCQAKCRBcpIk+abn8 Tp2JAKCTzkjE32Q8dazATdi5F3jNsWHYbwCfb1jw+YM6yaua+Gc+KkeOZbFxgtA= =MGIp -----END PGP SIGNATURE----- --nextPart2108249.AKfn3jg4vr--