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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 2610DC4742C for ; Thu, 5 Nov 2020 14:39:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 AE77920786 for ; Thu, 5 Nov 2020 14:39:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="foNWY/9N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE77920786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: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=5KrUCTfoCVOmwecH7CVbjhhdgkztiX6A8f4/aftEyk4=; b=foNWY/9Ng8nfUbIB/vLI6C3mc SmAM8LPOROFxjEvni8xG0IOdQaxsmhv7lSB77YizDaX/JMNSOnPDqf7rKW/3rIHcU04PxW1+OPsq6 MRElYiHVHABCADLc9WfypvequfVZUzD3dI48jxn8tVus2GpD8aEE59yhG5YZ26yvcz8rFMVKD3cg1 jnslYpHbkUQqG27JpIMIyAan79/wyaimxvSQI7P+Qgd8jpVMZfSuR7ijdBfrmiukKkKFDwqXTKDfA Wt0sby+f0jwfwSrh1ZabOolhArYSuNhwvYbQ6oPcVBmikhm67x8ZxrbJwC7ccGpkT9XfDTFDAxSr2 fZsHTSf8w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kagPm-0006RE-D5; Thu, 05 Nov 2020 14:39:02 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kagPj-0006Q5-3I for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 14:39:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DB61414BF; Thu, 5 Nov 2020 06:38:57 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.58.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3B68D3F719; Thu, 5 Nov 2020 06:38:55 -0800 (PST) Date: Thu, 5 Nov 2020 14:38:52 +0000 From: Mark Rutland To: Mark Brown Subject: Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source Message-ID: <20201105143852.GJ82102@C02TD0UTHF1T.local> References: <20201105125656.25259-1-andre.przywara@arm.com> <20201105125656.25259-5-andre.przywara@arm.com> <20201105134142.GA4856@sirena.org.uk> <20201105140322.GH82102@C02TD0UTHF1T.local> <20201105142949.GB4856@sirena.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201105142949.GB4856@sirena.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_093859_230101_82AF811C X-CRM114-Status: GOOD ( 28.27 ) 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: Lorenzo Pieralisi , linux-kernel@vger.kernel.org, Andre Przywara , Linus Walleij , Sudeep Holla , Russell King , kvmarm@lists.cs.columbia.edu, Catalin Marinas , Will Deacon , Ard Biesheuvel , 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 05, 2020 at 02:29:49PM +0000, Mark Brown wrote: > On Thu, Nov 05, 2020 at 02:03:22PM +0000, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 01:41:42PM +0000, Mark Brown wrote: > > > > It isn't obvious to me why we don't fall through to trying the SMCCC > > > TRNG here if for some reason the v8.5-RNG didn't give us something. > > > Definitely an obscure possibility but still... > > > I think it's better to assume that if we have a HW RNG and it's not > > giving us entropy, it's not worthwhile trapping to the host, which might > > encounter the exact same issue. > > There's definitely a good argument for that, but OTOH it's possible the > SMCCC implementation is doing something else (it'd be an interesting > implementation decision but...). That said I don't really mind, I think > my comment was more that if we're doing this the code should be explicit > about what the intent is since right now it isn't obvious. Either a > comment or having an explicit "what method are we choosing" thing. > > > That said, I'm not sure it's great to plumb this under the > > arch_get_random*() interfaces, e.g. given this measn that > > add_interrupt_randomness() will end up trapping to the host all the time > > when it calls arch_get_random_seed_long(). > > > Is there an existing interface for "slow" runtime entropy that we can > > plumb this into instead? > > Yeah, I was wondering about this myself - it seems like a better fit for > hwrng rather than the arch interfaces but that's not used until > userspace comes up, the arch stuff is all expected to be quick. I > suppose we could implement the SMCCC stuff for the early variants of the > API you added so it gets used for bootstrapping purposes and then we > rely on userspace keeping things topped up by fetching entropy through > hwrng or otherwise but that feels confused so I have a hard time getting > enthusiastic about it. I'm perfectly happy for the early functions to call this, or for us to add something new firmwware_get_random_*() functions that we can call early (and potentially at runtime, but less often than arch_get_random_*()). I suspect the easy thing to do for now is plumb this into the existing early arch functions and hwrng. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel