Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp493449pxb; Thu, 5 Nov 2020 05:45:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzlVRIyqlvhwcezUI0I7hiA9af2Wm4HBl5nm2Slhgy9HYGQ0mXqjk760h4GL/hCMK0Qb4V X-Received: by 2002:a17:906:892:: with SMTP id n18mr2316328eje.1.1604583946536; Thu, 05 Nov 2020 05:45:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604583946; cv=none; d=google.com; s=arc-20160816; b=qBTLmruEmJLiE2epNAIs+I/B2BD+VFVJjTMcSkq7E1wUzUBtoEp+TsbhzHsTu33LSv Eb0RW1BsclDeCLIJ0YnFblWG4ihRpuo+Yn4G/UKpVlYwHHTe8g+WB+Ymda/LIBP2lYUL Us9S0H83taxiBcUUrqNh0G550gjcne5Coo6LMdKPRYQRkxAvhU13eOy8Fqj1K591GLbM CNlxIYGoEI4oyUCAw6IvkEcnUBuggfXWeWOJZeyRHwWJTFd4Ho2rCyzOk2sC6MNcHn+6 L/Ae57k15nUBc3xuy6FGPDy10p8Zkj3Qn6+sxexZGglKbI9ctonA0E/sYm0MLfNkOxWH xfvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=f8gMhR6pnDVJj3WmMsFJ6xt7qPkwV0+Tg65W2AhKKU0=; b=LHU9eMI2K+qNsKvbnrRF6FsKkKUuzovN4y6cYqKKbmkzzwzEnY5NOaldniiXWCKDKJ 6s5rqvKs/QUPnsKg6RcI/yoimqdg3XUrvH6DHaBsJivUHF8DMEKe5VPyTFygl84P0nO6 LM5OIna5A2k4uldcUGFj0ZpKGSPKOY7Qm9u+BESIDKgJ2LRLUIudT4vU2FuiDWhvSNi2 ddkSpq9AKNyYSTzR3GnYZ+OEZlLb10sORD+FiWT+emB0jrKZuGiSUIBInkmBdQ41AN1k 550F8AILgJqeHuGXQd080zhyOWhhTkvsIXZ0J+aGaqTL0681e4ZhvJ2v5UrxuY7QvNM6 plWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j0S+M/t9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p19si1133999edu.169.2020.11.05.05.45.23; Thu, 05 Nov 2020 05:45:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j0S+M/t9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730687AbgKENly (ORCPT + 99 others); Thu, 5 Nov 2020 08:41:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:50326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgKENly (ORCPT ); Thu, 5 Nov 2020 08:41:54 -0500 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CBB5F20729; Thu, 5 Nov 2020 13:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604583713; bh=4w//0GOBcyazzgOmqfL5NKULnMf1kmugV10nGsnPnCM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j0S+M/t95EKp2myinviXxYBn/BVNlmZenfledxlLsLuLXYeNEUag6xwL4pHwW23yE CKLpj6aYbmL1uY8vflma3+jebsh3Rzddy8UhnShGvtINtt6rQPcSVhZpQYGil8i2uY Q20pR7IzGI7f6VesD8+v9DH4vegwrZx4D0ScIsJ8= Date: Thu, 5 Nov 2020 13:41:42 +0000 From: Mark Brown To: Andre Przywara Cc: Will Deacon , Catalin Marinas , Ard Biesheuvel , Russell King , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , Linus Walleij Subject: Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source Message-ID: <20201105134142.GA4856@sirena.org.uk> References: <20201105125656.25259-1-andre.przywara@arm.com> <20201105125656.25259-5-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20201105125656.25259-5-andre.przywara@arm.com> X-Cookie: It's the thought, if any, that counts! User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 05, 2020 at 12:56:55PM +0000, Andre Przywara wrote: > static inline bool __must_check arch_get_random_seed_int(unsigned int *v) > { > + struct arm_smccc_res res; > unsigned long val; > - bool ok =3D arch_get_random_seed_long(&val); > =20 > - *v =3D val; > - return ok; > + if (cpus_have_const_cap(ARM64_HAS_RNG)) { > + if (arch_get_random_seed_long(&val)) { > + *v =3D val; > + return true; > + } > + return false; > + } 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... --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl+kARUACgkQJNaLcl1U h9DYuwf8CUvDX3fgFkHQzB4oHxVc26hBdjs1LMP8HGSRCDcCKTl8g0oPmxO620Eg Gi7jDuTY0fyXAqxIJY6mqyAxuWwoEhN37zqHBqDKoIIQoqr7S2XenF+4PZauH7A/ 3/E8QnNxZCWUCZkgmjwa5GAa5Yt2SHNnZOXe4kx81SHBdMBcMgM4VnVS1eag/Rsu 5PZ/HFJQAB3PQQQ4+MtYkWqfurTTnQruH/sT1CxWa6WHbUWwStSsmtrbjwLx/3nz SHD1UXnMH5WycZQ55m++AGD9xzSZGFRlbgEcXltNPMg8ern/xeCt5EpCKl262D+I ujIYv72Mo/6CrpMqQrXsK7jzc5pHHg== =6PnH -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--