[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c380729c-9cba-6639-de9b-64d3d0896110@gmail.com>
Date: Thu, 2 Apr 2020 11:07:08 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Will Deacon <will@...nel.org>
Cc: linux-kernel@...r.kernel.org, hsinyi@...omium.org,
geert+renesas@...der.be, swboyd@...omium.org, robh@...nel.org,
tytso@....edu
Subject: Re: [PATCH] Documentation: dt-bindings: Document 'rng-seed' for
/chosen
On 4/2/2020 1:13 AM, Will Deacon wrote:
> Hi Florian,
>
> On Wed, Apr 01, 2020 at 08:36:40PM -0700, Florian Fainelli wrote:
>> The /chosen node can have a 'rng-seed' property read as a u32 quantity
>> which would contain a random number provided by the boot agent. This is
>> useful in configurations where the kernel does not have access to a
>> random number generator.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
>> ---
>> Documentation/devicetree/bindings/chosen.txt | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>
> Thanks for doing this; I realised it was undocumented the other day when I
> tried to look it up myself.
>
>> diff --git a/Documentation/devicetree/bindings/chosen.txt b/Documentation/devicetree/bindings/chosen.txt
>> index 45e79172a646..126b31eecfeb 100644
>> --- a/Documentation/devicetree/bindings/chosen.txt
>> +++ b/Documentation/devicetree/bindings/chosen.txt
>> @@ -28,6 +28,19 @@ mode) when EFI_RNG_PROTOCOL is supported, it will be overwritten by
>> the Linux EFI stub (which will populate the property itself, using
>> EFI_RNG_PROTOCOL).
>>
>> +rng-seed
>> +--------
>> +
>> +This property is used to initialize the kernel's entropy pool from a
>> +trusted boot agent capable of providing a random number. It is parsed
>> +as a u32 value, e.g.
>
> Are you sure about this being limited to a u32 value? I thought you could
> pass an arbitrary-length value here.
Humm indeed, we can pass an arbitrary value, I completely conflated the
type of "l" here:
int l;
...
rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l);
with how much we would be reading from the property, which is complete
nonsense. Out of curiosity, what property length do platforms typically
populate?
--
Florian
Powered by blists - more mailing lists