Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1014009pxy; Sun, 1 Aug 2021 09:28:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCqzF3995hkhpy8iDINxFhDcgo4tGqa6eHKKyv8qHCOQ6gjtgCJiRsfwrKYkHLdqTTDz99 X-Received: by 2002:a17:906:7f16:: with SMTP id d22mr11863982ejr.135.1627835299519; Sun, 01 Aug 2021 09:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627835299; cv=none; d=google.com; s=arc-20160816; b=DIL0eS6TB7uREF36ymdFbaZR3XKWwg+g6/X7d4lUtGwc/DIQ/dM3bq/x4QYBdgHMk1 fmrMsygpB+ejshEOIiLRbPgLPip0+Brvjhl3ViKiAu/HCPdPbequT+sPIKmnatS9VhJ2 781e0FlqRhWxBcxKAfAG3ysSBs46zJ1VixvYMh9qOjmb/pe1CSafrtK8OLtZPANkm3gO 7lFUeP9mM2rRdEyEL3Vf6c6oi6MbZI0ALpJPNXpFKbNmi5BJ9Yr6FkXHaPe91iZ2IMel CK51hOnG4Jb0AsJxjcFFix1Aopq8F+xAP5UbMgUjv4xLTHM8ijVtOpgdWMI3bFShNGAN SFwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jqVXkOvyg5xNHR0A6Fsw9F+FRGkf7DFbN+ONNzPBAms=; b=O9Z9sYwputCBo1pKrxdU7zs0KTRMJ+qtItFaq2ve3B2iWVO5XHcFgLFgU/6U6fSaqS 5K49sUKXCo7azAY68gdORs6o9DrSX0dpxwql/Sm7J78+gO4SRMD6lCsQsbryQHPi9WDN Ae5KkE3dX+IijqoZfW4Qs59uH3F1uNa6ehH8mu6B3psjXBbF1L+zHzq71BEq02fEru03 ne+JdjwLrdWZ8W3GdGvCYzQYA0UzCJADLeTmW6+hHQAzA9bYTIs6LH+xq3BsvxCqnhMO QKr4NyJ3jbzPGMcIkXlr53lv4biK/Ira+Zou4mLnnefSPn5iGMz3W3CiBos4SooVTQ4l qayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DnAh/UDl"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si8046794edb.360.2021.08.01.09.27.43; Sun, 01 Aug 2021 09:28:19 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DnAh/UDl"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229553AbhHAQ01 (ORCPT + 99 others); Sun, 1 Aug 2021 12:26:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:39638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229665AbhHAQ00 (ORCPT ); Sun, 1 Aug 2021 12:26:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C8EDE61059; Sun, 1 Aug 2021 16:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627835178; bh=wpnk83J5W52Cehu0wTsNOKGTslGIXxW1DA6xKjVj57M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DnAh/UDly7Bn0jw4Rv0lAOs+BP9fRFpRJ/mOb6SlFksnOaustk1C1zIKWJdaGLcN3 prkT96qGygOkaS0SMa5L7B6uyFneKgHoAqxdhdLOco0PCXlKrN9FShTZRwIqNVPkJB uLPFH1/9vLf9bRkaXt/TJMlZ348c8BM6orf/ckyV+tSmRBC3Fyb2YZRDoEKyrcExHP 4glY7k39R4pPFuut4CXMiZ3wNE7qeAkxW4yXFzOEJxxkbD26vkoD3M8+oHAR1L17Lr EpOc4yaoEJfn2uTAIN/Ltcpnywu0vZ4t4befktkosYOICOGU2MjDU3SMXxjJ3+aWiQ jIakZzd4Ac4sw== Received: by mail-oi1-f179.google.com with SMTP id n16so14652745oij.2; Sun, 01 Aug 2021 09:26:18 -0700 (PDT) X-Gm-Message-State: AOAM532yTa0IZ+KFzRPniqbjwEj9U4gdy7jxqH2bstLf6WHKzD+1CQKp BYc+KsQtSj6m1hctPd4rdoouGgU+ztkTrpx9BMI= X-Received: by 2002:aca:4c49:: with SMTP id z70mr7775755oia.174.1627835178131; Sun, 01 Aug 2021 09:26:18 -0700 (PDT) MIME-Version: 1.0 References: <20210731204845.21196-1-andre.przywara@arm.com> In-Reply-To: <20210731204845.21196-1-andre.przywara@arm.com> From: Ard Biesheuvel Date: Sun, 1 Aug 2021 18:26:06 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/2] hwrng: Add Arm SMCCC TRNG based driver To: Andre Przywara Cc: Matt Mackall , Herbert Xu , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , Linux Crypto Mailing List , Linux ARM , Linux Kernel Mailing List , Benjamin Herrenschmidt , Mark Brown , Will Deacon , Ali Saidi , Jon Nettleton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sat, 31 Jul 2021 at 22:49, Andre Przywara wrote: > > The "Arm True Random Number Generator Firmware Interface"[1] provides > an SMCCC based interface to a true hardware random number generator. > So far we are using that in arch_get_random_seed(), but it might be > useful to expose the entropy through the /dev/hwrng device as well. This > allows to assess the quality of the implementation, by using "rngtest" > from the rng-tools package, for example. > > Patch 1 creates a platform device, triggered by the previous discovery > of the SMCCC TRNG service. > Patch 2 implements a hw_random platform driver, which is instantiated > through this said platform device. > > The driver can be loaded as module, or built into the kernel. > > [1] https://developer.arm.com/documentation/den0098/latest/ > > Changelog v3 ... v4: > - drop pointless driver loading message > - drop unneeded init() routine > > Changelog v2 ... v3: > - split platform device and driver > > Changelog v1 ... v2: > - fix building as a module > - de-register device upon exit > - mention module name in Kconfig > > Andre Przywara (2): > firmware: smccc: Register smccc_trng platform device > hwrng: Add Arm SMCCC TRNG based driver > Reviewed-by: Ard Biesheuvel > drivers/char/hw_random/Kconfig | 14 +++ > drivers/char/hw_random/Makefile | 1 + > drivers/char/hw_random/arm_smccc_trng.c | 123 ++++++++++++++++++++++++ > drivers/firmware/smccc/smccc.c | 17 ++++ > 4 files changed, 155 insertions(+) > create mode 100644 drivers/char/hw_random/arm_smccc_trng.c > > -- > 2.17.6 >