Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: memtestplus

On Wed, 7 Jun 2017, Patrick Welche wrote:

On Mon, Jun 05, 2017 at 11:54:04AM -0400, M. Levinson wrote:
On Jun 5, 2017, at 1:09pm, Patrick Welche writes:
memtestplus starts on boot, I am given the option for safe mode, but come
what may, as soon as testing starts, the laptop reboots.

I saw the same symptom you're seeing, and I found that the smp_find_cpus()
function in smp.c simply didn't work on my system. Since the failure isn't
detected and act_cpus is initialized to 0, memtest rebooted after a division
by zero at line 1159 in main.c:

	case 7: /* Block move */
		ticks = (ch + ch/act_cpus + c*ch);

I crudely sidestepped the problem by forcing it to always use only one CPU:

diff --git a/smp.h b/smp.h
--- a/smp.h
+++ b/smp.h
@@ -7,7 +7,7 @@
 #define _SMP_H_
 #include "stdint.h"
 #include "defs.h"
-#define MAX_CPUS 32
+#define MAX_CPUS 1

 #define FPSignature ('_' | ('M' << 8) | ('P' << 16) | ('_' << 24))

The above worked for me on -current/amd64! This particular laptop
has an Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz, so I also tried
MAX_CPUS 2, which failed.

The above fix also works on a QEMU-emulated Haswell processor with option "-smp 4" specified. The display does report that smp is disabled, as one would expect.

As an aside, should

 multiboot memtestplus maxcpus=1

have worked? (Never tried multiboot.)

I never touched multiboot either.

| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |

Home | Main Index | Thread Index | Old Index