BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: "Jason A. Donenfeld" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c040862bfbd9c5f3cb64e1df1c623e20e38fe656
commit: 049f9ae93d033be6758ad865a9b89650f9f075ec x86/rdrand: Remove "nordrand" 
flag in favor of "random.trust_cpu"
date:   3 weeks ago
:::::: branch date: 2 hours ago
:::::: commit date: 3 weeks ago
config: i386-randconfig-m021 
(https://download.01.org/0day-ci/archive/20220805/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
arch/x86/kernel/cpu/rdrand.c:38 x86_init_rdrand() error: uninitialized symbol 
'prev'.

vim +/prev +38 arch/x86/kernel/cpu/rdrand.c

49d859d78c5aeb9 H. Peter Anvin     2011-07-31  13  
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  14  /*
0007bccc3cfd1e6 Len Brown          2015-08-16  15   * RDRAND has 
Built-In-Self-Test (BIST) that runs on every invocation.
049f9ae93d033be Jason A. Donenfeld 2022-07-09  16   * Run the instruction a few 
times as a sanity check. Also make sure
049f9ae93d033be Jason A. Donenfeld 2022-07-09  17   * it's not outputting the 
same value over and over, which has happened
049f9ae93d033be Jason A. Donenfeld 2022-07-09  18   * as a result of past CPU 
bugs.
049f9ae93d033be Jason A. Donenfeld 2022-07-09  19   *
049f9ae93d033be Jason A. Donenfeld 2022-07-09  20   * If it fails, it is simple 
to disable RDRAND and RDSEED here.
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  21   */
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  22  
148f9bb87745ed4 Paul Gortmaker     2013-06-18  23  void x86_init_rdrand(struct 
cpuinfo_x86 *c)
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  24  {
049f9ae93d033be Jason A. Donenfeld 2022-07-09  25       enum { SAMPLES = 8, 
MIN_CHANGE = 5 };
049f9ae93d033be Jason A. Donenfeld 2022-07-09  26       unsigned long sample, 
prev;
049f9ae93d033be Jason A. Donenfeld 2022-07-09  27       bool failure = false;
049f9ae93d033be Jason A. Donenfeld 2022-07-09  28       size_t i, changed;
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  29  
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  30       if (!cpu_has(c, 
X86_FEATURE_RDRAND))
0007bccc3cfd1e6 Len Brown          2015-08-16  31               return;
49d859d78c5aeb9 H. Peter Anvin     2011-07-31  32  
049f9ae93d033be Jason A. Donenfeld 2022-07-09  33       for (changed = 0, i = 
0; i < SAMPLES; ++i) {
049f9ae93d033be Jason A. Donenfeld 2022-07-09  34               if 
(!rdrand_long(&sample)) {
049f9ae93d033be Jason A. Donenfeld 2022-07-09  35                       failure 
= true;
049f9ae93d033be Jason A. Donenfeld 2022-07-09  36                       break;
0007bccc3cfd1e6 Len Brown          2015-08-16  37               }
049f9ae93d033be Jason A. Donenfeld 2022-07-09 @38               changed += i && 
sample != prev;

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to