hwrng on 82801EB/ER (ICH5/ICH5R) fails rngtest checks
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 62 lines · Andrew Morton
with latest HEAD of Linus' tree I got
/dev/hwrngbut although the device exists rngtest does not pass as if hwrng does not work correctly. actually this case is documented in the README supplied by Debian but I'm surprised to hit the problem.I'm just curious whether there's a bug in the driver, the hwrng is bad or if it is falsely detected and made accessible via
/dev/hwrng.rngtest 2-unofficial-mt.10
Copyright (c) 2004 by Henrique de Moraes Holschuh
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.rngtest: starting FIPS tests...
rngtest: bits received from input: 200032
rngtest: FIPS 140-2 successes: 0
rngtest: FIPS 140-2 failures: 10
rngtest: FIPS 140-2(2001-10-10) Monobit: 10
rngtest: FIPS 140-2(2001-10-10) Poker: 10
rngtest: FIPS 140-2(2001-10-10) Runs: 10
rngtest: FIPS 140-2(2001-10-10) Long run: 10
rngtest: FIPS 140-2(2001-10-10) Continuous run: 10
rngtest: input channel speed: (min=1.132; avg=2.157; max=2.794)Mibits/s
rngtest: FIPS tests speed: (min=202.909; avg=206.647; max=211.928)Mibits/s
rngtest: Program run time: 89804 microsecondslspci
00:00.0 Host bridge: Intel Corporation E7520 Memory Controller Hub (rev 0c) 00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 0c)
00:06.0 PCI bridge: Intel Corporation E7520 PCI Express Port C (rev 0c) 00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Cont roller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2) 00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Brid ge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
01:03.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27) 01:04.0 System peripheral: Compaq Computer Corporation Integrated Lights Out Con troller (rev 01)
01:04.2 System peripheral: Compaq Computer Corporation Integrated Lights Out Pr ocessor (rev 01)
02:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 0
9)
02:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 0
9)
03:01.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethe rnet (rev 10)
03:01.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethe rnet (rev 10)
04:03.0 RAID bus controller: Compaq Computer Corporation Smart Array 64xx (rev 0
Quoted 8 lines
1)
05:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 0
9)
05:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 0
9)
0a:01.0 PCI bridge: IBM PCI-X to PCI-X Bridge (rev 03)
0b:04.0 RAID bus controller: Compaq Computer Corporation Smart Array 64xx (rev 0
1)
I guess you are running the Intel ICH RNG, right? As the FIPS test is a hardware test, I would simply say it's failing hardware. But let's not do this. :) Let's check what actually comes out of the RNG.
Could you do a
hexdump /dev/hwrng
So we can see what actually comes ot of the device. Let's see if it's all zeros or something.
Does the RNG work, if you use 2.6.17 or earlier?
Signature · 1 line
Greetings Michael.
Quoted 82 lines · Michael Buesch
Quoted 62 lines · Andrew Morton
with latest HEAD of Linus' tree I got
/dev/hwrngbut although the device exists rngtest does not pass as if hwrng does not work correctly. actually this case is documented in the README supplied by Debian but I'm surprised to hit the problem.I'm just curious whether there's a bug in the driver, the hwrng is bad or if it is falsely detected and made accessible via
/dev/hwrng.rngtest 2-unofficial-mt.10
Copyright (c) 2004 by Henrique de Moraes Holschuh
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.rngtest: starting FIPS tests...
rngtest: bits received from input: 200032
rngtest: FIPS 140-2 successes: 0
rngtest: FIPS 140-2 failures: 10
rngtest: FIPS 140-2(2001-10-10) Monobit: 10
rngtest: FIPS 140-2(2001-10-10) Poker: 10
rngtest: FIPS 140-2(2001-10-10) Runs: 10
rngtest: FIPS 140-2(2001-10-10) Long run: 10
rngtest: FIPS 140-2(2001-10-10) Continuous run: 10
rngtest: input channel speed: (min=1.132; avg=2.157; max=2.794)Mibits/s
rngtest: FIPS tests speed: (min=202.909; avg=206.647; max=211.928)Mibits/s
rngtest: Program run time: 89804 microsecondslspci
00:00.0 Host bridge: Intel Corporation E7520 Memory Controller Hub (rev 0c) 00:02.0 PCI bridge: Intel Corporation E7525/E7520/E7320 PCI Express Port A (rev 0c)
00:06.0 PCI bridge: Intel Corporation E7520 PCI Express Port C (rev 0c) 00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Contr oller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Cont roller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2) 00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Brid ge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
01:03.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27) 01:04.0 System peripheral: Compaq Computer Corporation Integrated Lights Out Con troller (rev 01)
01:04.2 System peripheral: Compaq Computer Corporation Integrated Lights Out Pr ocessor (rev 01)
02:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 0
9)
02:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 0
9)
03:01.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethe rnet (rev 10)
03:01.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5704 Gigabit Ethe rnet (rev 10)
04:03.0 RAID bus controller: Compaq Computer Corporation Smart Array 64xx (rev 0Quoted 8 lines
1)
05:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev 0
9)
05:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev 0
9)
0a:01.0 PCI bridge: IBM PCI-X to PCI-X Bridge (rev 03)
0b:04.0 RAID bus controller: Compaq Computer Corporation Smart Array 64xx (rev 0
1)I guess you are running the Intel ICH RNG, right? As the FIPS test is a hardware test, I would simply say it's failing hardware. But let's not do this. :) Let's check what actually comes out of the RNG.
Could you do a
hexdump/dev/hwrng
So we can see what actually comes ot of the device. Let's see if it's all zeros or something.
Quoted 1 line
Does the RNG work, if you use 2.6.17 or earlier?
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *
with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *
this was without any rng-tools installed and no rngd running of course.
Quoted 7 lines · On Wednesday 26 July 2006 16:21, gmu 2k6 wrote:
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *
Quoted 6 lines
with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *this was without any rng-tools installed and no rngd running of course.
Hm, so I would say the hardware either broken, or intel changed the way to read the random data from it. But I doubt they would change something like this on the ICH5.
Who wrote the ICH driver? Jeff? Philipp?
What do you think?
Signature · 1 line
Greetings Michael.
Quoted 13 lines · Michael Buesch
Quoted 12 lines · On Wednesday 26 July 2006 16:21, gmu 2k6 wrote:
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *
Quoted 8 lines
Quoted 1 line
this was without any rng-tools installed and no rngd running of course.
Hm, so I would say the hardware either broken, or intel changed the way to read the random data from it. But I doubt they would change something like this on the ICH5.
Who wrote the ICH driver? Jeff? Philipp?
What do you think?
IIRC it was Jeff.
Quoted 16 lines · On Wednesday 26 July 2006 16:52, gmu 2k6 wrote:
Quoted 15 lines · Michael Buesch
Quoted 13 lines · On Wednesday 26 July 2006 16:21, gmu 2k6 wrote:
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *this was without any rng-tools installed and no rngd running of course.
Quoted 8 lines
Quoted 6 lines
Hm, so I would say the hardware either broken, or intel changed the way to read the random data from it. But I doubt they would change something like this on the ICH5.
Who wrote the ICH driver? Jeff? Philipp?
What do you think?IIRC it was Jeff.
"What do you think?" was more a question to Jeff or Philipp ;)
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
drivers/char/hw_random/intel-rng.c +5 -0
@@ -104,9 +104,14 @@int err = -EIO ; hw_status =hwstatus_get (mem); + hw_status =hwstatus_set (mem, hw_status & ~INTEL_RNG_ENABLED ); + hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#if 0 + hw_status =hwstatus_get (mem);/* turn RNG h/w on, if it's off */ if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#endif if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;
Signature · 1 line
Greetings Michael.
Quoted 43 lines · Michael Buesch
Quoted 16 lines · On Wednesday 26 July 2006 16:52, gmu 2k6 wrote:
Quoted 15 lines · Michael Buesch
Quoted 13 lines · On Wednesday 26 July 2006 16:21, gmu 2k6 wrote:
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *this was without any rng-tools installed and no rngd running of course.
Quoted 8 lines
Quoted 6 lines
Hm, so I would say the hardware either broken, or intel changed the way to read the random data from it. But I doubt they would change something like this on the ICH5.
Who wrote the ICH driver? Jeff? Philipp?
What do you think?IIRC it was Jeff.
"What do you think?" was more a question to Jeff or Philipp ;)
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;
with that diff applied I still seem to get the same result:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *
maybe the revision of ICH5 in this HP ProLiant box is borked (IIRC without going down to the datacenter it should be a ProLiant 380 something bought last year).
Quoted 43 lines · Michael Buesch
Quoted 16 lines · On Wednesday 26 July 2006 16:52, gmu 2k6 wrote:
Quoted 15 lines · Michael Buesch
Quoted 13 lines · On Wednesday 26 July 2006 16:21, gmu 2k6 wrote:
it just outputs this and stops with 2.6.18-rc2-HEAD (see dmesg for hashcode or whatever that is which is appended as localversion)
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *with 2.6.17.6:
svn:~# hexdump /dev/hwrng 0000000 ffff ffff ffff ffff ffff ffff ffff ffff *this was without any rng-tools installed and no rngd running of course.
Quoted 8 lines
Quoted 6 lines
Hm, so I would say the hardware either broken, or intel changed the way to read the random data from it. But I doubt they would change something like this on the ICH5.
Who wrote the ICH driver? Jeff? Philipp?
What do you think?IIRC it was Jeff.
"What do you think?" was more a question to Jeff or Philipp ;)
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;
well as it didn't work, are you sure it was not intended to be more like this:
@@ -104,9 +104,14 @@
int err = -EIO;
hw_status = hwstatus_get(mem);
+ hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);
+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED);
+#if 0
/* turn RNG h/w on, if it's off */
if ((hw_status & INTEL_RNG_ENABLED) == 0)
hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED);
+#endif
if ((hw_status & INTEL_RNG_ENABLED) == 0) {
printk(KERN_ERR PFX "cannot enable RNG, aborting\n");
goto out;?
Quoted 40 lines · On Wednesday 26 July 2006 21:44, gmu 2k6 wrote:
Quoted 13 lines
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;well as it didn't work, are you sure it was not intended to be more like this:
drivers/char/hw_random/intel-rng.c +4
-0@@ -104,9 +104,14 @@int err = -EIO ; hw_status =hwstatus_get (mem); + hw_status =hwstatus_set (mem, hw_status & ~INTEL_RNG_ENABLED ); + hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#if 0 /* turn RNG h/w on, if it's off */ if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#endif if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;
Quoted 1 line
?
I don't think that makes a difference to the generated code, does it?
Signature · 1 line
Greetings Michael.
Quoted 41 lines · Michael Buesch
Quoted 40 lines · On Wednesday 26 July 2006 21:44, gmu 2k6 wrote:
Quoted 13 lines
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;well as it didn't work, are you sure it was not intended to be more like this:
drivers/char/hw_random/intel-rng.c +4
-0@@ -104,9 +104,14 @@int err = -EIO ; hw_status =hwstatus_get (mem); + hw_status =hwstatus_set (mem, hw_status & ~INTEL_RNG_ENABLED ); + hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#if 0 /* turn RNG h/w on, if it's off */ if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#endif if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;
Quoted 3 lines
Quoted 1 line
?
I don't think that makes a difference to the generated code, does it?
I will test it now as you seem to be interested in the results.
actually I was just curious what sense it made to dohw_status = hwstatus_get(mem);
twice, though I'm not informed about the semantics there so I could be wrong in interpreting the API on that level.
Quoted 46 lines · On Thursday 27 July 2006 16:20, gmu 2k6 wrote:
Quoted 41 lines · Michael Buesch
Quoted 40 lines · On Wednesday 26 July 2006 21:44, gmu 2k6 wrote:
Quoted 13 lines
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;well as it didn't work, are you sure it was not intended to be more like this:
drivers/char/hw_random/intel-rng.c +4
-0@@ -104,9 +104,14 @@int err = -EIO ; hw_status =hwstatus_get (mem); + hw_status =hwstatus_set (mem, hw_status & ~INTEL_RNG_ENABLED ); + hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#if 0 /* turn RNG h/w on, if it's off */ if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#endif if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;Quoted 3 lines
Quoted 1 line
?
I don't think that makes a difference to the generated code, does it?
Quoted 6 lines
I will test it now as you seem to be interested in the results.
actually I was just curious what sense it made to do
hw_status=hwstatus_get(mem);
twice, though I'm not informed about the semantics there so I could be wrong in interpreting the API on that level.
Look at the #if 0. The second hwstatus_get is not going to be compiled, anyway.
But Jan Beulich posted an interresting patch to lkml. Please test it.
http://marc.theaimsgroup.com/?l=linux-kernel&m=115399953714650&q=raw
Signature · 1 line
Greetings Michael.
Quoted 47 lines · Michael Buesch
Quoted 46 lines · On Thursday 27 July 2006 16:20, gmu 2k6 wrote:
Quoted 44 lines · Michael Buesch
Quoted 40 lines · On Wednesday 26 July 2006 21:44, gmu 2k6 wrote:
Quoted 13 lines
But could you try the following patch on top of latest git? It's just a random test, but I think it's worth trying. Let's see if it works around the issue.
Index:
linux-2.6/drivers/char/hw_random/intel-rng.c
===================================================================drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +1
-0@@ -104,9 +104,14 @@ int err = -EIO; hw_status = hwstatus_get(mem); + hw_status = hwstatus_set(mem, hw_status & ~INTEL_RNG_ENABLED);drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 line 117
Quoted 10 lines
drivers/char/hw_random/intel-rng.c 2006-07-26 17:27:03.000000000 +0200 renamed from drivers/char/hw_random/intel-rng.c 2006-06-27 17:48:13.000000000 +0200 +4
-0+ hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#if 0 + hw_status = hwstatus_get(mem); /* turn RNG h/w on, if it's off */ if ((hw_status & INTEL_RNG_ENABLED) == 0) hw_status = hwstatus_set(mem, hw_status | INTEL_RNG_ENABLED); +#endif if ((hw_status & INTEL_RNG_ENABLED) == 0) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;well as it didn't work, are you sure it was not intended to be more like this:
drivers/char/hw_random/intel-rng.c +4
-0@@ -104,9 +104,14 @@int err = -EIO ; hw_status =hwstatus_get (mem); + hw_status =hwstatus_set (mem, hw_status & ~INTEL_RNG_ENABLED ); + hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#if 0 /* turn RNG h/w on, if it's off */ if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) hw_status =hwstatus_set (mem, hw_status |INTEL_RNG_ENABLED ); +#endif if ((hw_status &INTEL_RNG_ENABLED ) ==0 ) { printk(KERN_ERR PFX "cannot enable RNG, aborting\n"); goto out;Quoted 1 line
?
I don't think that makes a difference to the generated code, does it?
Quoted 8 lines
Quoted 6 lines
I will test it now as you seem to be interested in the results.
actually I was just curious what sense it made to do
hw_status=hwstatus_get(mem);
twice, though I'm not informed about the semantics there so I could be wrong in interpreting the API on that level.Look at the #if 0. The second
hwstatus_getis not going to be compiled, anyway.
yep you're right, originally I caught it as because it won't be included in the gcc output at all and later on false thought it would be called twice after a long day of work. maybe I should take more time when replying to mails :D
Quoted 3 lines
But Jan Beulich posted an interresting patch to lkml. Please test it.
http://marc.theaimsgroup.com/?l=linux-kernel&m=115399953714650&q=raw
I saw that too and was thinking about trying it out, will do so now.
On 7/26/06, Michael Buesch <[email protected]> wrote:
[snip]
Quoted 1 line
I guess you are running the Intel ICH RNG, right?
yes as can be seen in dmesg and lspic output it's ICH5
[snip]