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=-7.5 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,USER_AGENT_GIT 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 ADD90C41604 for ; Tue, 6 Oct 2020 20:20: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 336762083B for ; Tue, 6 Oct 2020 20:20:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NogA5kib" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 336762083B 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:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1Vfs+qb5fcUtCrmCr0kHONDwNRMB7EOR/j/J7VV5T6o=; b=NogA5kiblAzep8v++k3q+xFCv0 eP0CwlNcOlbevLVpBRb0uuFesnPkco6QmZ1pHZ4ok+qg528GeoimBgnEcHG9j1vyd/5IOY/rmns3N PqbiOcr1dPRNcE6nl9772UWrkPaSVSDNAZLUBpkE+g3fy9eakGrfJkKoFFlSV+8IkL7yGffNAszaq Dhs5/FaLaay+QTy52Xf8lGSSby0PnEdfiI/xmY0G5WIjwxHe9avtn4TpGO7cfcFOKllQbmIsjN9IM fVa+r8sY8431ivQFMuyjxRZeIzJQktO7l7iE+Ex3jlzSjFYdvzrD2NdxUlZTm+/NJehLD6KXB+Ouc b3bJzpyg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPtQC-0007ZX-JS; Tue, 06 Oct 2020 20:18:52 +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 1kPtQ9-0007Yg-J2 for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2020 20:18:50 +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 E7A0F113E; Tue, 6 Oct 2020 13:18:47 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.195.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7B93D3F71F; Tue, 6 Oct 2020 13:18:46 -0700 (PDT) From: Andre Przywara To: Catalin Marinas , Will Deacon Subject: [PATCH 0/2] arm64: Add support for SMCCC TRNG interface Date: Tue, 6 Oct 2020 21:18:06 +0100 Message-Id: <20201006201808.37665-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_161849_694532_4D68E767 X-CRM114-Status: GOOD ( 11.86 ) 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 , Lorenzo Pieralisi , Richard Henderson , linux-kernel@vger.kernel.org, Mark Brown , Sudeep Holla , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 The ARM architected TRNG firmware interface, described in ARM spec DEN0098[1], defines an ARM SMCCC based interface to a true random number generator, provided by firmware. This is the arm64 implementation of that interface, implemented in the arch_get_random_*() code. Patch 1/2 introduces the SMCCC function identifiers, this is extracted from Ard's patch, to avoid dependencies between the several patches floating around (ARM, KVM, arm64). Patch 2/2 detects the interface and calls into the firmware upon a call to arch_get_random_seed_long(). Support for the "early" variant is under investigation. This was tested on: - QEMU -kernel (no SMCCC, regression test) - Juno w/ standard firmware (SMCCC, but no TRNG: regression test) - Juno w/ "fake TRNG" firmware (to verify "random" numbers) - Juno w/ prototype of the h/w Trusted RNG support - mainline KVM (SMCCC, but no TRNG: regression test) - Ard's KVM patch (plus hack to inject fake numbers for verification purposes) Cheers, Andre [1] https://developer.arm.com/documentation/den0098/latest/ Andre Przywara (1): arm64: Add support for SMCCC TRNG firmware interface Ard Biesheuvel (1): firmware: smccc: Add SMCCC TRNG function call IDs arch/arm64/include/asm/archrandom.h | 83 +++++++++++++++++++++++++---- include/linux/arm-smccc.h | 31 +++++++++++ 2 files changed, 104 insertions(+), 10 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel