[PATCH v2] powerpc/powernv: Use darn instr for random_seed on p9

Michael Ellerman mpe at ellerman.id.au
Thu Jul 13 12:44:10 AEST 2017


Matt Brown <matthew.brown.dev at gmail.com> writes:
> On Tue, Jul 11, 2017 at 7:34 PM, Daniel Axtens <dja at axtens.net> wrote:
>>> @@ -67,6 +69,21 @@ int powernv_get_random_real_mode(unsigned long *v)
>>>       return 1;
>>>  }
>>>
>>> +int powernv_get_random_darn(unsigned long *v)
>>
>> This is only referenced in this file so it should probably be labelled
>> as 'static'.
>>
>
> That's true, my thinking was to then use the get_random_darn where the
> get_random_long was being used.
> Looks like there is only one other caller of it at the moment,
> kvmppc_h_random (in arch/powerpc/kvm/book3s_hv_builtin.c).
> We may want to change that to get_random_darn.

It needs to use the right one depending on whether it's running on P8 or
P9.

It should really just use ppc_md.get_random_seed(), except that it can
be called in real mode, which means it needs to be more careful. So as
usual it's complicated :)

cheers


More information about the Linuxppc-dev mailing list