Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp317401ybl; Mon, 2 Dec 2019 11:12:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx44+Zby9hTL3zMY//8nmVjUNtwMjRiL2M6iKhkwOXcEC6H+Ia8kMzbx+6pzTGPctzilN1T X-Received: by 2002:a1c:f60f:: with SMTP id w15mr27174117wmc.132.1575313970327; Mon, 02 Dec 2019 11:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575313970; cv=none; d=google.com; s=arc-20160816; b=R5XkhMtohv371s2y8YOYIRdD5A4nmfY6hbBoNJiLB3XUkTV+a919rHw1kIE6xf6EbY IASR4qUy1ZTR5WCQvmt5+QGLS0DxCBR2VXrLwX+U4LUuiCmQ+JLV2FphHiBVmRvzQfy5 Y9T3kFVLbjb3oRpKZOVv8qOcIunTrx7ejcmepNKggGdmKjjTbIF4Kll8kxOtrW9h13n6 bVCVVMIY3eprrNIp7I8b9fZYKLbbjGNnWN4Y4VmbdZ1bdgS5gNpfsTAoxNdspmaZB20J A4QwtRtDWtHUsnMonca7jPxMWFjANjfCDuRIHNW+JTV1D/DzGI5tjZRybCnnv4JZ/EDv CNew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=FExJkTj9FuUm/buEah8/Dw8emZ0Jf0KXBUoEdakSsNc=; b=DKd3rfDMaX1CZrZNaNDgy6cbKoIotEWpSACUJ/bUR/XpEp8hZz3T/RiV08BG2LoJZN h3qqEn4qdFRz5wGw2Y2DeXLo9UIkYj6MJN0Uetka9wTXiN4FpY/XknAdMoiE66gyjCXV RBFNaA3cEousGGauZ0H25mPEuAq+Ewoj/2yphObcXbxDhyQY1E9O9KpyR4O/CmR9B1ls kBuVj0nW7vb+a4syTNtYmPHmXtYgNGqOCPRi1Cv+pL5XlDfozY5g7vZyBkKlDZuHOtzw UP7Bz+wCn3Rk0ZMSYb1vtVAl1fLR7mXWBPRpA4XdUoX+msggbsK95D84ipgyIY0SetfI Ghhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jz12si269346ejb.418.2019.12.02.11.12.12; Mon, 02 Dec 2019 11:12:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728004AbfLBTMC (ORCPT + 99 others); Mon, 2 Dec 2019 14:12:02 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:56958 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727977AbfLBTMC (ORCPT ); Mon, 2 Dec 2019 14:12:02 -0500 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 Cc: Neal Liu , Catalin Marinas , Will Deacon , Lars Persson , Mark Rutland , DTML , Herbert Xu , wsd_upstream , Sean Wang , Linux Kernel Mailing List , Rob Herring , "Crystal Guo (=?UTF-8?Q?=E9=83=AD=E6=99=B6?=)" , "linux-crypto@vger.kernel.org" , Matt Mackall , Matthias Brugger , "linux-mediatek@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.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...