Re: [PATCH v5 07/11] x86: use fallback for random_get_entropy() instead of zero

2022-04-19 Thread Jason A. Donenfeld
Hi Borislav, On Tue, Apr 19, 2022 at 8:59 PM Borislav Petkov wrote: > > On Tue, Apr 19, 2022 at 08:38:41PM +0200, Jason A. Donenfeld wrote: > > I think I prefer doing (a), and leaving (b) for another time when you > > or another x86 maintainer can do so. But I'll do whichever you say. > > Which w

Re: [PATCH v5 07/11] x86: use fallback for random_get_entropy() instead of zero

2022-04-19 Thread Jason A. Donenfeld
Hi Borislav, On Tue, Apr 19, 2022 at 8:16 PM Borislav Petkov wrote: > > +static inline unsigned long random_get_entropy(void) > > +{ > > +#ifndef CONFIG_X86_TSC > > + if (!boot_cpu_has(X86_FEATURE_TSC)) > > cpu_feature_enabled() pls. This function began as a carbon copy of get_cycles(), whic

[PATCH v5 07/11] x86: use fallback for random_get_entropy() instead of zero

2022-04-19 Thread Jason A. Donenfeld
In the event that random_get_entropy() can't access a cycle counter or similar, falling back to returning 0 is really not the best we can do. Instead, at least calling random_get_entropy_fallback() would be preferable, because that always needs to return _something_, even falling back to jiffies ev