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=-6.8 required=3.0 tests=BAYES_00, 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 7F927C41604 for ; Tue, 6 Oct 2020 20:18:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2EDEF2087E for ; Tue, 6 Oct 2020 20:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbgJFUSs (ORCPT ); Tue, 6 Oct 2020 16:18:48 -0400 Received: from foss.arm.com ([217.140.110.172]:56210 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725962AbgJFUSs (ORCPT ); Tue, 6 Oct 2020 16:18:48 -0400 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 Cc: Mark Rutland , Mark Brown , Ard Biesheuvel , Richard Henderson , Lorenzo Pieralisi , Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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