Commit Graph
51 Commits
Author SHA1 Message Date
Sam Demeulemeester eaeaff181b Add bus stress test with fine-grained R/W turnarounds (new test 9)
Two per-CPU streams alternate NT-store bursts of a fresh PRSG sequence with read-verify of the previous round, forcing write-to-read turnarounds and row conflicts; odd rounds insert idle gaps to provoke PMIC load steps. Targets DDR5-era interface faults (link SI, marginal XMP/EXPO training, voltage droop) that on-die ECC cannot correct
Moving PRSG vector kernels from mov_inv_rng.C to a shared module in tests/
2026-07-11 11:22:01 +02:00
Sam Demeulemeester 55d4508adc Reorder tests and rebalance iterations to reduce time-to-first-fault
Run the random sequence test (now #4) and Modulo-20 (now #6) before the 64-bit shifting pattern test (now #8), so that every fault class is probed early in the pass.
Trade the walker's redundant repetitions (3 -> 1 iteration, plus only every other offset on the fast first pass) for more never-repeating work (random sequence 24 -> 96 rounds, Modulo-20 6 -> 9), at unchanged pass time.
2026-07-11 11:22:01 +02:00
Sam Demeulemeester 4e76e517eb Add SIMD moving inversions test with random sequences (AVX2/SSE2)
Replace tests 5 & 8 with a single moving inversions test using per-lane
xorshift sequences and non-temporal stores. Kernels (inline asm) are picked
at runtime via the new system/simd module: AVX2, SSE2 or scalar, with the
tier shown in the test name.
Fix and enable the AVX/XCR0 startup code and decode the XSAVE/AVX/AVX2 CPUID flags.Suite shrinks from 11 to 10 tests.
2026-07-11 11:22:01 +02:00
Sam Demeulemeester ffe3890502 Add acknowlegdment for LA64 port in README.md 2026-07-07 16:39:56 +02:00
Sam DemeulemeesterandBerbe f9a30b0fa6 Add ECC polling option (#615)
Add ECC polling option (originally #566)

---------

Co-authored-by: Berbe <4251220+Berbe@users.noreply.github.com>
2026-05-17 19:39:23 +02:00
Gabriel Mongaras 1f0baf7a95 Added testlist to boot options (#570) 2025-11-29 13:24:46 +01:00
David Corvaglia 2b51351ab7 added serial newline option (#528) 2025-10-05 16:53:19 +02:00
Chao Li 3cb2cdd62a Updated README and adjusted Makefile for LoongArch64 (#499)
* build: Change the memtest.efi to mt86plus on LoongArch

Change the main binary from memtest.efi to mt86plus.

* build: Add GRUB iso support on LoongArch64

Enable the GRUB iso support on LoongArch64, it requires the LoongArch64
Linux ENV, so it is not possible create it on x86-64 Linux ENV.

* README: Add LoongArch content

Added LoongArch info and how to build, adjusted some style.

Signed-off-by: Chao Li <lichao@lonogson.cn>
2025-04-06 14:16:53 +02:00
Sam Demeulemeester 3b1d85291d Change README.md to add recently added 'dark' mode 2025-02-10 23:39:13 +01:00
01e3 71d061a4c7 Merge bootsect.S and setup.S into header.S (#467)
* Merge bootsect.S and setup.S into header.S

Currently, Memtest86+ provides two (three counting mbr.S) different
headers: bootsect.S and header.S that together with setup.S are used
to build the final binaries:
 - bootsect.S for booting from the legacy BIOS, used in memtest.bin.
 - header.S for booting from the UEFI, used in memtest.efi.

Both support loading by an intermediate bootloader. Also, both are
derived from the Linux kernel, but from a very different chapter in its
evolution. FDD loading was removed a very long time ago, many, many
years before adding PE/COFF headers for UEFI. Also, the PE/COFF headers
are large (even larger for x86-64) and take a lot of very limited space,
leaving almost no headroom for the actual code.

This commit merges bootsect.S and setup.S into header.S adding BIOS
(FDD) loading support, which should eventually enable to maintain a single,
all-in-one binary that can be booted either by an intermediate bootloader
(such as GRUB or LILO), UEFI and BIOS. Easier and less confusing for users,
as I have continued to see cases when people assume memtest.bin is needed
for non-UEFI systems, even if never intended for FDD loading.

To ensure we have enough space for both the boot code (limited to 512B
including Linux boot header and address of the New EXE header) and
UEFI headers, the PE/COFF headers got moved into the ".setup" section
of the code where *currently* we have 1024B total and about 90B free.
Should more space be needed in the future, we can grow that section or
perhaps even better - move PE/COFF into its own section that will not
even need to be loaded.

Overall, the code got copied from bootsect.S and setup.S with very, very
minimal changes, most importantly:

 - Dedicated routine for printing strings (print_string) got added and
   lives in the ".bootsect" section.

 - Print "Loading " message almost immediately after BIOS loads and
   calls code from the .bootsect" section, even before setting up
   the custom FDD parameter table. The sooner the better.

 - Set DX to 0x0000, as the code depends on its value. While the BIOS is
   expected to set DL register to the boot drive number which is 0 for FDD,
   to my knowledge there is no guarantee for DH to have any particular
   value. Also, when executing "MZ" signature as x86 instructions,
   the original value of DX becomes instantly and irrevocably lost. This
   is fine as we only support booting from FDD anyway.

 - Print "Memtest86+" and its version after loading the ".setup" section.
   We can get the string from mt86plus_version (kernel_version), no need
   to duplicate in the boot sector where we are very space limited and as
   a bonus we can provide the version information.

As diffstat shows a lot of code changed and added, it may be easier use
the following commands:
 diff -Nur bootsect.S header.S
 diff -Nur setup.S header.S

While there are several more changes and fixes I would like to make in the
boot code (some of them were already included in the earlier RFC version
[1] before we got UEFI signing support added) for now I tried this to be as
least disruptive as possible and avoid unnecessary code changes to make
the review easier.

[1] https://github.com/memtest86plus/memtest86plus/pull/136

* Bye bye memtest.bin and memtest.efi, long live mt86plus

With the efi binary providing the BIOS floppy loading functionality,
there is no need to support separate memtest.bin file any longer.

Remove memtest.bin from {build32,build64}/Makefile, replace memtest.bin
amd memtest.efi with mt86plus eveywhere to avoid confusion with
other memtests.

Also, unify build32/Makefile and build64/Makefile by removing
unnecessary differences between them, like extra spaces or
different OBJS order.

Finally, update README.md, HOW_TO_DEBUG_WITH_GDB.md and other
places that had a reference to memtest.{bin,efi}. Note that for
debug_memtest.sh, mt86plus.efi is used.
2025-01-27 19:43:24 +01:00
martinwhitaker 9ef7eae74e Improve BadRAM pattern collection and add more condensed error reporting modes (#454)
* badram: Make DEFAULT_MASK depend on ARCH_BITS, not x86_64 architecture.

* badram: Don't display leading zeros for BadRAM addresses.

* badram: Merge patterns immediately when there is no additional cost.

The current algorithm only starts merging patterns when num_patterns
equals MAX_PATTERNS, which can lead to having several patterns that
could have been merged into one at no additional cost. e.g.

patterns = [
  (0x00, 0xfffffffffffffff8),
  (0x08, 0xfffffffffffffff8)
]

can appear, even though

patterns = [
  (0x00, 0xfffffffffffffff0)
]

represents the exact same addresses at the same cost.

So, at the same time as we test whether an address is already covered,
also check if we can cheaply combine the new address with an existing
pattern.

* badram: Factor out code that wraps to a new line when necessary.

In preparation for next commit.

* badram: Add more modes for recording/displaying error maps.

The original code just supported recording and displaying patterns suitable
for use with the Linux BadRAM extension or GRUB badram command. With some
minor changes it can be made to record address ranges and display them
either in the format used by the Linux memmap boot command line option
or as a simple list of memory page numbers (which can be used with the
Windows bcdedit program).

* badram: Increase the number of stored patterns/ranges.

* Update README to include the new error reporting modes.
2024-11-11 23:57:21 +01:00
Martin Whitaker ded371e9da Note that BadRAM patterns exclude errors found in tests 0 and 7.
This was mentioned in the individual test descriptions in the README,
but easily missed (issue #384). Add a note in the BadRAM section of
the README and also in the error display heading.
2024-03-05 23:12:51 +00:00
Martin Whitaker 7b70c6e026 Fix typo in README. 2024-03-05 09:42:59 +00:00
martinwhitaker 20fca09752 Add boot options to perform display rotation and set preferred screen resolution (#383)
* Add boot option to rotate screen display through 90 degrees.

Some machines have a detachable display that can be used in either
portrait or landscape orientations, and require software to rotate
the displayed image accordingly. There is no way to detect the
current orientation through the BIOS, so provide a boot option to
control this. Hopefully we only need to support one (+90 degree)
angle.

Note that the rotate option only works in graphical mode. When booted
by a legacy BIOS using text mode, we have to rely on the BIOS to do
what's necessary.

* Extend boot command line options for display screen control.

Replace "rotate" option with "screen.rhs-up" and "screen.lhs-up" to
allow rotation in either direction. Add a "screen.mode=<w>x<h>"
option to set a preferred width <w> and height <h> for the UEFI
frame buffer. Also allow "screen.mode=bios" to use the default
UEFI frame buffer resolution.

* Add more debug output for EFI frame buffer mode.

* Replicate command line parsing of screen options in efisetup.c.

Trying to do it only once in screen.c didn't work, because static
variables initialied to zero are placed in the bss section, and we
don't zero the bss section until after efisetup() is executed.

The resulting code is in fact smaller, because the compiler can
optimise better when everything is local.

* Add a boot command line option for efisetup debug.

* Improve EFI debug test screen pattern.

* Document the new screen and efidebug boot command line options.

* Fix typo in README.
2024-03-04 14:49:13 +01:00
Martin Whitaker bda3776df1 Fix list item references in README (issue #352)
Markdown does not support using roman numerals for numbered lists, so
change all list item references in the text to arabic numerals.
2023-11-15 21:48:05 +00:00
Sam Demeulemeester 9e3958714b Add support for MMIO UART console (#300)
8/16/32-bit MMIO supported, with configuration options as kernel parameters.
2023-05-12 15:49:00 +02:00
Sam Demeulemeester 7aeac7271f Add Memory Controller Registers polling to get current DRAM Timings/Frequency (#306)
Read the memory controller configuration (instead of just relying on SPD data) to get the actual live settings.

Currently supported platforms:
* Intel SNB to RPL (Core 2nd Gen to Core 13th Gen) - Desktop only (no Server nor Mobile)
* AMD SMR to RPL (Zen to Zen4) - Desktop only (no Server, Mobile nor APU).


Individual commits below for archival:

* First functions skeleton for reading IMC/ECC Registers

* Change directory name from 'chipsets' to 'mch' (Memory Controller Hub)

* Add Intel HSW and fix new files encoding

* First Intel HSW IMC implementation

* Add an option to disable MCH registers polling

* Remove old include from Makefiles

* Better Makefile and padding fixes

* Statically init 'imc' struct to generate string relocation record

* Small typos & code fixes

* Add IMC support for Intel Core 6/7/8/9th Gen (SKL/KBL/CFL/CML) This is a bit more complex than Haswell and below because MMIO switched to 64-bit with Skylake (lot of) betatesting needed

* Add IMC read support for Intel SNB/IVB (2nd/3rd gen Core)

* Fix hard-lock on Intel SNB/IVB due to wrong access type on MCHBAR pointer

* Move AMD SMN Registers & offsets to a specific header file

* Add IMC Read support for AMD Zen/Zen2 CPUs

* Change 'IMC' to 'MCH' in Makefiles to match actual mch/ directory

* Add IMC Reading support for Intel ADL&RPL CPUs (Core Gen12&13)

* Add support for Intel Rocket Lake (Core 11th Gen) and AMD Vermeer

* Add IMC reading for AMD Zen4 'Raphael' AM5 CPUs

* Various Cleanup #1 
Change terminology from Intel-based 'MCH' (Memory Controller Hub) to more universal 'IMC' (Integrated Memory Controller) Integrate imc_type var into imc struct. Remove previously created AMD SNM header file

* Various Cleanup 2

* Change DDR5 display format for IMC specs
DDR5 Freq can be > 10000 and timings up to 63-127-127-127, which overwflow the available space.
This commit remove the raw frequency on DDR5 (which may be incorrect due to Gear mechanism) and leave a bit of space to display the Gear engaged in the future
2023-05-12 15:33:28 +02:00
Sam Demeulemeester a1d046fc3a Fix a typo in README.md (serial console baud rate) 2023-02-18 18:51:02 +01:00
martinwhitaker 186ef6e913 Improved own addr test (#219)
* For 64-bit images, use the physical address as the test pattern in test 2.

This will make it easier to diagnose faults.

* Disable test 1 by default (issue #155).

Test 2 provides the same test coverage. Test 1 may make it slightly easier
to diagnose faults with a 32-bit image, so leave it as an option.

* For 32 bit images, use the physical address to generate the offset in test 2.

Detecting a stage change and using that to reset the offset counter
could fail when the config menu was used to skip to the next test
(issue #224).
2023-01-04 23:26:22 +01:00
martinwhitaker d0399fd287 Add a command line option to disable the big PASS/FAIL status display. (#227) 2023-01-04 16:16:55 +01:00
Sam Demeulemeester 1ee1078cf5 V6.00 Final Release PR (#187)
* Avoid FAIL banner being partially overwriten by new errors

* Remove beta on main title

* Remove v6 Beta Disclaimer & some README.me changes for release
2022-10-23 17:32:17 +02:00
Martin Whitaker 1278f02617 Add new code contributions section to README table of contents. 2022-10-09 18:26:51 +01:00
Martin Whitaker 85213a9a27 Add code contribution section to the README, referencing the README_DEVEL. 2022-10-09 13:51:32 +01:00
Martin Whitaker 83d08db69e Document the lack of support for USB hot-plugging in the README. 2022-10-09 13:45:26 +01:00
Martin Whitaker 93051adfc2 Update README.
- update text to indicate that benchmarking and SPD reporting has
  now been restored
- point to GitHub issue tracker for known limitations and bugs
2022-08-20 10:18:25 +01:00
a1346054 9660eead4e Simple maintenance improvements (#145)
* Fix typos

* Add missing final newline

* Trim trailing whitespace
2022-08-15 17:51:48 +02:00
Martin Whitaker 13d9569041 By default, only enable USB keyboard detection when booted in UEFI mode.
Most legacy BIOSs will support USB legacy keyboard emulation. Using that
will avoid having to reserve memory for the USB drivers, and should
improve the chance of having a working keyboard without having to work
around various USB device quirks.
2022-07-24 13:56:41 +01:00
martinwhitaker e6e0f0c8e7 USB improvements (#116)
* Add new heap manager.

* Convert OHCI driver to use new heap manager.

* Convert UHCI driver to use new heap manager.

* Convert EHCI driver to use new heap manager.

* Convert XHCI driver to use new heap manager.

* Convert SMP to use new heap manager.

* Add a "usbinit" boot option to handle various buggy USB devices.

This replaces the "keyboard=buggy-usb" option, and adds a second
workaround to handle the problem seen in issue #107.
2022-07-16 13:34:08 +02:00
Sam Demeulemeester fae2ae9e13 Update README.md with new console parameters 2022-06-01 00:09:55 +02:00
Sam Demeulemeester a67d346ef7 Update README.md
- Add 'console' parameters details in boot options
- Change the header for the release for binary release
- Remove solved known bugs
2022-05-05 23:19:50 +02:00
Martin Whitaker af54067228 Execute smp_init() before keyboard_init() in case ACPI tables are overwritten.
When USB keyboard detection is enabled, physical memory pages are reserved
for use by the USB drivers. The physical memory map exposed by pmem.h does
not indicate where the ACPI tables reside, so we may end up using pages
that contain ACPI tables (or for that matter, the boot parameters and boot
command line). So rather than introduce a more complicated memory allocation
scheme, make sure we have finished with all the data passed to us by the
BIOS and/or boot loader before we start probing for USB devices.

The only downside to this is that it is no longer possible to interactively
disable parsing of the ACPI tables - that can now only be done by using the
"nosmp" boot option.
2022-05-04 22:42:31 +01:00
Martin Whitaker 7b41830c40 Change "smp" boot option to "nosmp".
SMP is now enabled by default, so we need an option to disable it.
2022-05-04 22:16:14 +01:00
Sam Demeulemeester d38df135db Update README.md before going public 2022-03-24 21:49:56 +01:00
Martin Whitaker d04ec9f681 Rename to Memtest86+ v6.0. 2022-02-19 19:44:58 +00:00
Martin Whitaker c5e9fa4e18 Increase maximum number of APs to 256. 2022-01-29 16:13:05 +00:00
Martin Whitaker 563c8a1ee7 Add support for EHCI USB controller. 2022-01-23 17:38:50 +00:00
Martin Whitaker 79ec174a82 Update known limitations in README, now USB hubs are supported. 2022-01-09 21:45:07 +00:00
Martin Whitaker e5663fc8f9 Added more detail to the README. 2021-12-24 15:04:02 +00:00
Martin Whitaker e19dc26e33 Fix markdown in README. 2021-12-24 00:21:12 +00:00
Martin Whitaker 5684d0bb7a Add boot command line options and keyboard selection to README. 2021-12-24 00:13:19 +00:00
Martin Whitaker ad6c7d0455 Use F10 (or '0'), not ESC to exit menus.
This avoids accidentally rebooting by pressing the key too many times.
2021-12-23 11:11:42 +00:00
Martin Whitaker 33230c511d Allow F10 to be used as an alternative to ESC (issue #5). 2021-10-16 10:35:58 +01:00
Martin Whitaker a4afd784ce Document use of number keys as altermatives to the function keys. 2021-07-25 10:09:49 +01:00
Martin Whitaker f1f6d4ecae Correction to README: maximum number of badram patterns is 10. 2021-07-18 20:33:06 +01:00
Martin Whitaker 27c5fe363f Add startup option to enable/disable SMP. 2020-12-10 13:51:39 +00:00
Martin Whitaker def681e914 Update documentation. 2020-07-09 16:20:23 +01:00
Martin Whitaker 144e13845d README improvements. 2020-05-25 13:51:06 +01:00
Martin Whitaker ae8e515d75 More README fixes. 2020-05-24 22:02:51 +01:00
Martin Whitaker 165f512f0a Various fixes to README. 2020-05-24 21:51:14 +01:00
Martin Whitaker fbd3376668 Initial commit. 2020-05-24 21:30:55 +01:00