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 EBE8BC4742C for ; Thu, 5 Nov 2020 14:31:45 +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 78BC0206A4 for ; Thu, 5 Nov 2020 14:31:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Q9UHKeTn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78BC0206A4 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=zqDgtO1jbmQcg3Jv6fH4sPDM6/hCZ0VH6hnhq1bI/nk=; b=Q9UHKeTnGiRfaBmiu/wVrjYpp jtLNB8/dyfCK8XKmEcwSEw1F/TUGl2ue0T376j+pklVsdUlhrMLSGMGXHSEyupXFMMF6dFM+U535B cEWgF/hqhUaphkjkXUUneJLK8a1QvBC9xKpD+nwLRx630smbSgfKGdagmheFjt8NypDGxHbUj1xqO iBNtcxFmr8/dymtB1cZl8e9tYDAQjo8s0JZbevzINAMDxOSyRmdHi2lSuXm7dPpiOe/K2PLoV/HZ+ PBHkvURryejnsYmLTW2RR0LFheLxl4hov65qAIxKYmzu6WABoIRBSYBCuNSo+Lu81l0UG8g3AK9Js AvmneM5KA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kagHd-00043u-I7; Thu, 05 Nov 2020 14:30:37 +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 1kagHa-00042M-Im for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 14:30:35 +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 9462114BF; Thu, 5 Nov 2020 06:30:30 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.58.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D2363F719; Thu, 5 Nov 2020 06:30:26 -0800 (PST) Date: Thu, 5 Nov 2020 14:30:23 +0000 From: Mark Rutland To: Ard Biesheuvel Subject: Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source Message-ID: <20201105143023.GI82102@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> 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_093034_713527_9CCED2D3 X-CRM114-Status: GOOD ( 15.56 ) 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 , Andre Przywara , Linus Walleij , Sudeep Holla , Russell King , Linux Kernel Mailing List , 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:04:57PM +0100, Ard Biesheuvel wrote: > On Thu, 5 Nov 2020 at 15:03, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 01:41:42PM +0000, Mark Brown wrote: > > > On Thu, Nov 05, 2020 at 12:56:55PM +0000, Andre Przywara 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: [ 1.083802] ------------[ cut here ]------------ [ 1.084802] add_interrupt_randomness called [ 1.085685] WARNING: CPU: 1 PID: 0 at drivers/char/random.c:1267 add_interrupt_randomness+0x2e8/0x318 [ 1.087599] Modules linked in: [ 1.088258] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.10.0-rc2-dirty #13 [ 1.089672] Hardware name: linux,dummy-virt (DT) [ 1.090659] pstate: 60400085 (nZCv daIf +PAN -UAO -TCO BTYPE=--) [ 1.091910] pc : add_interrupt_randomness+0x2e8/0x318 [ 1.092965] lr : add_interrupt_randomness+0x2e8/0x318 [ 1.094021] sp : ffff80001000be80 [ 1.094732] x29: ffff80001000be80 x28: ffff2d0c80209840 [ 1.095859] x27: 00000000137c3e3a x26: ffff8000100abdd0 [ 1.096978] x25: 0000000000000035 x24: ffff67918bda8000 [ 1.098100] x23: ffffc57c31923fe8 x22: 00000000fffedc14 [ 1.099224] x21: ffff2d0dbef796a0 x20: ffffc57c331d16a0 [ 1.100339] x19: ffffc57c33720a48 x18: 0000000000000010 [ 1.101459] x17: 0000000000000000 x16: 0000000000000002 [ 1.102578] x15: 00000000000000e7 x14: ffff80001000bb20 [ 1.103706] x13: 00000000ffffffea x12: ffffc57c337b56e8 [ 1.104821] x11: 0000000000000003 x10: ffffc57c3379d6a8 [ 1.105944] x9 : ffffc57c3379d700 x8 : 0000000000017fe8 [ 1.107073] x7 : c0000000ffffefff x6 : 0000000000000001 [ 1.108186] x5 : 0000000000057fa8 x4 : 0000000000000000 [ 1.109305] x3 : 00000000ffffffff x2 : ffffc57c337455d0 [ 1.110428] x1 : db8dc9c2a1e0f600 x0 : 0000000000000000 [ 1.111552] Call trace: [ 1.112083] add_interrupt_randomness+0x2e8/0x318 [ 1.113074] handle_irq_event_percpu+0x48/0x90 [ 1.114016] handle_irq_event+0x48/0xf8 [ 1.114826] handle_fasteoi_irq+0xa4/0x130 [ 1.115689] generic_handle_irq+0x30/0x48 [ 1.116528] __handle_domain_irq+0x64/0xc0 [ 1.117392] gic_handle_irq+0xc0/0x138 [ 1.118194] el1_irq+0xbc/0x180 [ 1.118870] arch_cpu_idle+0x20/0x30 [ 1.119630] default_idle_call+0x8c/0x350 [ 1.120479] do_idle+0x224/0x298 [ 1.121163] cpu_startup_entry+0x28/0x70 [ 1.121994] secondary_start_kernel+0x184/0x198 ... and I couldn't immediately spot why 32-bit arm would be different. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel