linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: Add support for SMCCC TRNG interface
@ 2020-10-06 20:18 Andre Przywara
  2020-10-06 20:18 ` [PATCH 1/2] firmware: smccc: Add SMCCC TRNG function call IDs Andre Przywara
  2020-10-06 20:18 ` [PATCH 2/2] arm64: Add support for SMCCC TRNG firmware interface Andre Przywara
  0 siblings, 2 replies; 7+ messages in thread
From: Andre Przywara @ 2020-10-06 20:18 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Mark Rutland, Lorenzo Pieralisi, Richard Henderson, linux-kernel,
	Mark Brown, Sudeep Holla, Ard Biesheuvel, linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-12  6:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 20:18 [PATCH 0/2] arm64: Add support for SMCCC TRNG interface Andre Przywara
2020-10-06 20:18 ` [PATCH 1/2] firmware: smccc: Add SMCCC TRNG function call IDs Andre Przywara
2020-10-06 20:18 ` [PATCH 2/2] arm64: Add support for SMCCC TRNG firmware interface Andre Przywara
2020-10-07 10:48   ` Mark Brown
2020-10-07 14:16   ` James Morse
2020-10-07 14:43     ` André Przywara
2020-10-12  6:35       ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).