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 A1CFBC4741F for ; Thu, 5 Nov 2020 14:46:44 +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 1487220A8B for ; Thu, 5 Nov 2020 14:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nEmcfj4r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1487220A8B 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=1eQNylzC4UOku08etydotiRgHdvQIAa3clCuImPfSFk=; b=nEmcfj4r+CMigCafMm6l9PXzd A8d8ky2mE2nn4V4RGwnHW7sTUyuLwDY06ny2qGhkfP+HfxuBqoX5T8dqixDi2Pe1A654L5VPKBez+ FZG6QZOeiPoeyxBdUAlJRg3WRe6kbiM0Fo4SL7W0IQInCFyGv6bGyPRHa+OWaXKti3YhXkwYZScUw sBSF2DCjaIYeyY/rTMjznEJwrU03YZNOKVkJd7C4TdjIc3Mp0twKvGFA00re3MTOMwjcsSxm3LbFc 8SCkbA65IioxQB670R1NtZ4LyrZlP2a7NCmF6UnJReab/iHbf5GKP+/c6Pxr/ur22yYI2OtZ6Z+4O 5qasTKMCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kagWC-0007Ts-3w; Thu, 05 Nov 2020 14:45:40 +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 1kagW9-0007St-FI for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 14:45:38 +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 7557D14BF; Thu, 5 Nov 2020 06:45:36 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.58.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A86743F718; Thu, 5 Nov 2020 06:45:33 -0800 (PST) Date: Thu, 5 Nov 2020 14:45:30 +0000 From: Mark Rutland To: Ard Biesheuvel Subject: Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source Message-ID: <20201105144530.GK82102@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> <20201105143023.GI82102@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_094537_577842_AB7AF255 X-CRM114-Status: GOOD ( 21.76 ) 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 , Marc Zyngier , Linus Walleij , Sudeep Holla , Russell King , Linux Kernel Mailing List , Andre Przywara , Mark Brown , Catalin Marinas , Will Deacon , kvmarm , Linux ARM 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 03:34:01PM +0100, Ard Biesheuvel wrote: > On Thu, 5 Nov 2020 at 15:30, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 03:04:57PM +0100, Ard Biesheuvel wrote: > > > On Thu, 5 Nov 2020 at 15:03, Mark Rutland wrote: > > > > > > 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(). > > > > > > As it turns out, add_interrupt_randomness() isn't actually used on ARM. > > > > It's certainly called on arm64, per a warning I just hacked in: [...] > > ... and I couldn't immediately spot why 32-bit arm would be different. > > Hmm, I actually meant both arm64 and ARM. > > Marc looked into this at my request a while ago, and I had a look > myself as well at the time, and IIRC, we both concluded that we don't > hit that code path. Darn. > > In any case, the way add_interrupt_randomness() calls > arch_get_random_seed_long() is absolutely insane, so we should try to > fix that in any case. I have no strong opinion there, and I'm happy with that getting cleaned up. Regardless, I do think it's reasonable for the common code to expect that arch_get_random_*() to be roughly as expensive as "most other instructions" (since even RNDR* is expensive the CPU might be able to do useful speculative work in the mean time), whereas a trap to the host is always liable to be expensive as no useful work can be done while the host is handling it, so I think it makes sense to distinguish the two. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel