lkml.org 
[lkml]   [2022]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 04/11] mips: use fallback for random_get_entropy() instead of zero
On Sun, 24 Apr 2022, Jason A. Donenfeld wrote:

> > unconditionally. I think this discovery asks for code optimisation, which
> > I'll try to cook up sometime.
>
> At some point too, by the way, we might also consider putting that into
> a .c file rather than a static inline in the .h, since that function is
> starting to get sort of big.

This code is supposed to produce one to a couple of machine instructions
for the majority of configurations. This is because the conditionals used
are usually compile-time constants. Therefore I think it will be good to
continue having it as `static inline' functions. Cf. the analysis in
commit 06947aaaf9bf ("MIPS: Implement random_get_entropy with CP0
Random").

If this code does expand to a longer sequence for some platforms, then
either they need to be verified whether they can be optimised (just as I
note here for the DEC systems) or we can consider making these functions
`extern inline' instead, with out-of-line code available from a .a file in
case the compiler decides the code is too large for inlining to be worth
doing after all. Though I don't expect the latter case to be required
really.

Maciej

\
 
 \ /
  Last update: 2022-04-24 12:52    [W:0.502 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site