Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-12 Thread André Przywara
On 05/11/2020 14:38, Mark Rutland wrote: Hi, > On Thu, Nov 05, 2020 at 02:29:49PM +, Mark Brown wrote: >> On Thu, Nov 05, 2020 at 02:03:22PM +, Mark Rutland wrote: >>> On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: >> It isn't obvious to me why we don't fall through to

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Marc Zyngier
On 2020-11-05 14:34, Ard Biesheuvel wrote: On Thu, 5 Nov 2020 at 15:30, Mark Rutland wrote: 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 +, Mark Brown wrote: > > > On Thu, Nov 05,

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Rutland
On Thu, Nov 05, 2020 at 03:34:01PM +0100, Ard Biesheuvel wrote: > On Thu, 5 Nov 2020 at 15:30, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 03:04:57PM +0100, Ard Biesheuvel wrote: > > > On Thu, 5 Nov 2020 at 15:03, Mark Rutland wrote: > > > > > > That said, I'm not sure it's great to plumb

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Rutland
On Thu, Nov 05, 2020 at 02:29:49PM +, Mark Brown wrote: > On Thu, Nov 05, 2020 at 02:03:22PM +, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: > > > > It isn't obvious to me why we don't fall through to trying the SMCCC > > > TRNG here if for some

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Ard Biesheuvel
On Thu, 5 Nov 2020 at 15:30, Mark Rutland wrote: > > 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 +, Mark Brown wrote: > > > > On Thu, Nov 05, 2020 at 12:56:55PM +, Andre

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread André Przywara
On 05/11/2020 14:03, Mark Rutland wrote: > On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: >> On Thu, Nov 05, 2020 at 12:56:55PM +, Andre Przywara wrote: >> >>> static inline bool __must_check arch_get_random_seed_int(unsigned int *v) >>> { >>> + struct arm_smccc_res res; >>>

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Rutland
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 +, Mark Brown wrote: > > > On Thu, Nov 05, 2020 at 12:56:55PM +, Andre Przywara wrote: > > That said, I'm not sure it's great to plumb

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Brown
On Thu, Nov 05, 2020 at 02:03:22PM +, Mark Rutland wrote: > On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: > > 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

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Ard Biesheuvel
On Thu, 5 Nov 2020 at 15:03, Mark Rutland wrote: > > On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: > > On Thu, Nov 05, 2020 at 12:56:55PM +, Andre Przywara wrote: > > > > > static inline bool __must_check arch_get_random_seed_int(unsigned int *v) > > > { > > > + struct

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Rutland
On Thu, Nov 05, 2020 at 01:41:42PM +, Mark Brown wrote: > On Thu, Nov 05, 2020 at 12:56:55PM +, 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 =

Re: [PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Mark Brown
On Thu, Nov 05, 2020 at 12:56:55PM +, 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 = arch_get_random_seed_long(); > > - *v = val; > - return ok; >

[PATCH v2 4/5] arm64: Add support for SMCCC TRNG entropy source

2020-11-05 Thread Andre Przywara
The ARM architected TRNG firmware interface, described in ARM spec DEN0098, defines an ARM SMCCC based interface to a true random number generator, provided by firmware. This can be discovered via the SMCCC >=v1.1 interface, and provides up to 192 bits of entropy per call. Hook this SMC call into