From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABC83C432C3 for ; Mon, 2 Dec 2019 19:12:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B403217D7 for ; Mon, 2 Dec 2019 19:12:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="C/b6msJt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B403217D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Mwd5blNtUoFFzRt1fwyvILq10Zr1woafjv7psx6gzBc=; b=C/b6msJtXwgGHz pX9U5/YNbmMZo8W7ovIl1mNPS4eYJ+2zWIGXgSArnZuK//WctSNT/UKNi+3S1EQq2rhW9IjwQyC9J X2+jfKPTuOtKJvjbauDiOBw1xWwdsGVxQVRvCRnsgIHDo1S208HvS8IUvOPAgg3cFKz/Lti27hAQ7 oixVPep7+KqfKKcLB4BABrZmRuMGejWBUyrYSKgl2LGsPMdLMULorOQuCd3nKpj/eRzmVeI7L/YcI 223ytZa7m74u6AO2WGpVmpLRlBJ6zMClkNJZruC00xlHK1+QdYBPlH3aNMzOdFaN6FWipfXe3pAma 2302iU46SOtw0XGsQgPw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibr7F-0006nL-H7; Mon, 02 Dec 2019 19:12:13 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ibr79-0006lU-3b; Mon, 02 Dec 2019 19:12:09 +0000 Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.80) (envelope-from ) id 1ibr6q-0006Qj-Gm; Mon, 02 Dec 2019 20:11:48 +0100 Date: Mon, 2 Dec 2019 19:11:46 +0000 From: Marc Zyngier To: Ard Biesheuvel Subject: Re: [PATCH v5 3/3] hwrng: add mtk-sec-rng driver Message-ID: <20191202191146.79e6368c@why> In-Reply-To: References: <1574864578-467-1-git-send-email-neal.liu@mediatek.com> <1574864578-467-4-git-send-email-neal.liu@mediatek.com> <1575027046.24848.4.camel@mtkswgap22> Organization: Approximate X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: ard.biesheuvel@linaro.org, neal.liu@mediatek.com, catalin.marinas@arm.com, will@kernel.org, lists@bofh.nu, mark.rutland@arm.com, devicetree@vger.kernel.org, herbert@gondor.apana.org.au, wsd_upstream@mediatek.com, sean.wang@kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, Crystal.Guo@mediatek.com, linux-crypto@vger.kernel.org, mpm@selenic.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191202_111208_078181_0F50DF17 X-CRM114-Status: GOOD ( 19.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , DTML , Herbert Xu , wsd_upstream , Catalin Marinas , Sean Wang , "linux-mediatek@lists.infradead.org" , Linux Kernel Mailing List , Rob Herring , Neal Liu , "linux-crypto@vger.kernel.org" , Matt Mackall , Matthias Brugger , "Crystal Guo \(=?UTF-8?Q?=E9=83=AD=E6=99=B6?=\)" , Will Deacon , Lars Persson , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2 Dec 2019 16:12:09 +0000 Ard Biesheuvel wrote: > (adding some more arm64 folks) > > On Fri, 29 Nov 2019 at 11:30, Neal Liu wrote: > > > > On Fri, 2019-11-29 at 18:02 +0800, Lars Persson wrote: > > > Hi Neal, > > > > > > On Wed, Nov 27, 2019 at 3:23 PM Neal Liu wrote: > > > > > > > > For MediaTek SoCs on ARMv8 with TrustZone enabled, peripherals like > > > > entropy sources is not accessible from normal world (linux) and > > > > rather accessible from secure world (ATF/TEE) only. This driver aims > > > > to provide a generic interface to ATF rng service. > > > > > > > > > > I am working on several SoCs that also will need this kind of driver > > > to get entropy from Arm trusted firmware. > > > If you intend to make this a generic interface, please clean up the > > > references to MediaTek and give it a more generic name. For example > > > "Arm Trusted Firmware random number driver". > > > > > > It will also be helpful if the SMC call number is configurable. > > > > > > - Lars > > > > Yes, I'm trying to make this to a generic interface. I'll try to make > > HW/platform related dependency to be configurable and let it more > > generic. > > Thanks for your suggestion. > > > > I don't think it makes sense for each arm64 platform to expose an > entropy source via SMC calls in a slightly different way, and model it > as a h/w driver. Instead, we should try to standardize this, and > perhaps expose it via the architectural helpers that already exist > (get_random_seed_long() and friends), so they get plugged into the > kernel random pool driver directly. Absolutely. I'd love to see a standard, ARM-specified, virtualizable RNG that is abstracted from the HW. > Note that in addition to drivers based on vendor SMC calls, we already > have a RNG h/w driver based on OP-TEE as well, where the driver > attaches to a standardized trusted OS interface identified by a UUID, > and which also gets invoked via SMC calls into secure firmware. ... and probably an unhealthy number of hypervisor-specific hacks that do the same thing. The sooner we plug this, the better. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel