Is there a free (libre) open source alternative to memtest86+ that works with UEFI?

Yes, there is, in the Linux kernel itself: the memtest option will run a memory check with up to 17 patterns (currently). If you add memtest to your kernel boot parameters, it will run all tests at boot, and reserve any failing addresses so that they’re not used. If you want fewer tests, you can specify the number of patterns (memtest=8 for example).

This isn’t as extensive as Memtest86+’s tests, but it still gives pretty good results.

Some distribution kernels don’t include this feature; you can check whether it’s available by looking for CONFIG_MEMTEST in your kernel configuration (try /boot/config-$(uname -r)). The kernel won’t complain if you specify memtest but it doesn’t support it; when it does run, you should see output like

[    0.000000] early_memtest: # of tests: 17
[    0.000000]   0x0000000000010000 - 0x0000000000099000 pattern 4c494e5558726c7a
[    0.000000]   0x0000000000100000 - 0x0000000003800000 pattern 4c494e5558726c7a
[    0.000000]   0x000000000500d000 - 0x0000000007fe0000 pattern 4c494e5558726c7a
[    0.000000]   0x0000000000010000 - 0x0000000000099000 pattern eeeeeeeeeeeeeeee
[    0.000000]   0x0000000000100000 - 0x0000000003800000 pattern eeeeeeeeeeeeeeee
[    0.000000]   0x000000000500d000 - 0x0000000007fe0000 pattern eeeeeeeeeeeeeeee
[    0.000000]   0x0000000000010000 - 0x0000000000099000 pattern dddddddddddddddd
[    0.000000]   0x0000000000100000 - 0x0000000003800000 pattern dddddddddddddddd
[    0.000000]   0x000000000500d000 - 0x0000000007fe0000 pattern dddddddddddddddd
[    0.000000]   0x0000000000010000 - 0x0000000000099000 pattern bbbbbbbbbbbbbbbb
[    0.000000]   0x0000000000100000 - 0x0000000003800000 pattern bbbbbbbbbbbbbbbb
...

while the kernel boots (or in its boot logs, later).

You can use QEMU to get a feel for this:

qemu-system-x86_64 -kernel /boot/vmlinuz-$(uname -r) -append "memtest console=ttyS0" -nographic

(or whichever qemu-system-... is appropriate for your architecture), and look for “early_memtest”. To exit QEMU after the kernel panics, press Ctrla, c, q, Enter.

Tags:

Uefi