Commit Graph

46 Commits

Author SHA1 Message Date
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
Lionel Debroux
53ca89f8ae Add initial NUMA awareness support (#378)
* Add a file containing useful macro definitions, currently a single top-level macro for obtaining the size of an array; use it to replace a sizeof(x) / sizeof(x[0]) construct in system/smbus.c . This requires switching the GCC build mode from C11 to C11 with GCC extensions.

* Initial NUMA awareness (#12) support: parse the ACPI SRAT to build up new internal structures related to proximity domains and affinity; use these structures in setup_vm_map() and calculate_chunk() to skip the work on the processors which don't belong to the proximity domain currently being tested.

Tested on a number of 1S single-domain, 2S multi-domain and 4S multi-domain platforms.

SKIP_RANGE(iterations) trick by Martin Whitaker.
2024-03-13 01:43:26 +01:00
Sam Demeulemeester
5dde13b0a1 Preliminary ECC support for AMD Zen CPUs (#353)
* Initial commit for ECC support. Preliminary support for AMD Zen.

* Clear ECC registers at startup

* Add config flag (enable_ecc_polling) to toggle ECC polling. (Currently disabled by default for v7 release)
2023-11-29 12:53:05 +01:00
Sam Demeulemeester
de4f4768fc Fix various temperature-related issues on older Atom CPUs
Also, remove the no_temperature var to keep only the enable_temperature flag
Older Atom still have the enable_temperature flag hard-coded to false until further tests are done
2023-05-18 16:03:48 +02: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
Lionel Debroux
8f788b27e1 Add support for configuring the error reporting mode through the command line. Fixes #83. 2023-01-23 15:49:45 +01:00
Lionel Debroux
f24e897883 Add support for configuring the CPU sequencing mode through the command line. Reorder tests in app/config.c::parse_option alphabetically. Fixes #82. 2023-01-23 15:49:45 +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
9a86f115f4 Add 'press any key to remove' message on banner
By default, don't re-display FAIL banner after it has been discarded (#130 & #173)
Add an option to re-display FAIL banner even if previously discarded
2022-11-27 23:34:43 +01: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
89e2643de4 Add AP Enumeration to distinguish P-Core from E-Core on Hybrid CPUs (#62)
Add AP Enumeration to distinguish E-Core from P-Core on Intel Hybrid CPUs, and exclude them from the selected cores by default.  Including E-Cores slows down some tests and takes longer to catch memory errors.

A new exclude_ecores flag has been added in config.c to include E-Cores if needed.
2022-07-16 13:28:53 +02:00
Sam Demeulemeester
722b1b2899 Fix console kernel parameters parsed too late at boot (#66). Reorder global init to start tty after config parsed. Allow a wider options for console argument (ie: console - console=ttySx - console=ttySx,115200 2022-05-12 16:55:52 +02:00
Sam Demeulemeester
c56fbe3257 Change serial console baud rate parameters to match conventional linux kernel - ie: console=ttyS0,115200 for 115200 bps (#64) 2022-05-10 23:59:20 +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
Martin Whitaker
aa40bfb738 Accept up to 4 digits when reading CPU numbers in config menu (issue #50). 2022-04-23 16:06:53 +01:00
Martin Whitaker
66c6dfa357 Reduce pause at start delay to 3 seconds. 2022-04-17 22:53:39 +01:00
Martin Whitaker
644a13c730 Add usbdebug command line option and conditionally pause at end of USB scan.
If the usbdebug option is present, pause at the end of the USB scan until
a key is pressed. Otherwise, if the keyboard=usb option is present and no
USB keyboards were discovered, pause for 10 seconds. Otherwise don't pause.
2022-04-17 22:46:17 +01:00
Sam Demeulemeester
979b85548d Rework Line #7 left block. Add preliminary CPUID function to detect CPU Topology 2022-04-16 13:31:28 +02:00
Sam Demeulemeester
5580f7562d Add tracking & display for maximum CPU Temperature. Make the enable_temperature flag working as expected 2022-04-16 13:31:28 +02:00
Martin Whitaker
ae2c010610 uhci: fix device speed setting when constructing a transfer descriptor. 2022-04-10 11:53:01 +01:00
Martin Whitaker
f14d1fed52 Really add the noehci boot command line option.
(file missed in last commit)
2022-04-06 17:31:47 +01:00
Sam Demeulemeester
2e048a7c61 Add support for Serial/TTY (#32)
* Add preliminary support for TTY Serial/UART (#15)

* Use shadow_buffer instead of VGA buffer to get a framebuffer-agnostic TTY supprot

* Added menu browsing & inputs from Serial TTY (#15)

* Add fix for degree symbol on TTY. Correct serial.c & serial.h file created with CRLF (#15)

* Move tty_error_redraw() to insure correct redraw when a error occurs

* Many reindent / cleanup

* Various optimization from @martinwhitaker comments
2022-04-04 18:31:54 +02:00
Sam Demeulemeester
ee80684c4f Separate benchmark from smbus/smbios and add a separate flag to enable/disable it 2022-04-01 20:34:52 +02:00
Sam DEMEULEMEESTER
2266151fe6 Early SMBUS functions (#2) & EFI Reset (#17) 2022-03-24 21:49:56 +01:00
Martin Whitaker
4078b7760e Faster barrier implementation.
The old barrier implementation was very slow when running on a multi-socket
machine (pcmemtest issue 16).

The new implementation provides two options:

  - when blocked, spin on a thread-local flag
  - when blocked, execute a HLT instruction and wait for a NMI

The first option might be faster, but we need to measure it to find out. A
new boot command line option is provided to select between the two, with a
third setting that uses a mixture of the two.
2022-02-28 22:05:21 +00:00
Martin Whitaker
06d670e9a8 Make sure the boot command line is accessible during startup.
If we remap other regions, it's possible it could get overlaid.
2022-02-28 22:05:21 +00:00
Lionel Debroux
7b6855f608 Add CLI arguments for enabling trace. 2022-02-22 10:59:58 +01:00
Martin Whitaker
16b066c3e3 Exit config menu immediately when "skip test" is selected. 2022-02-13 12:38:38 +00:00
Martin Whitaker
2bf1623733 Halt CPU cores that are not active in a test.
This saves a lot of power when performing sequential tests.
2022-02-12 19:30:14 +00:00
Martin Whitaker
16d55b7dad Remove distinction between physical and virtual CPUs.
This is no longer needed, now we can display as many CPUs as we can
physically handle.
2022-01-31 22:59:14 +00:00
Martin Whitaker
17093a96f9 Optimise the AP startup code to reduce the startup delay. 2022-01-31 19:47:32 +00:00
Martin Whitaker
7c3e7d536c Allow cursor keys to be used in CPU mode and error mode config menus. 2022-01-30 15:47:17 +00:00
Martin Whitaker
e13b8bbb83 Increase config pop-up window width.
Also add more constant definitions to better parameterise the layout.
2022-01-30 15:37:13 +00:00
Martin Whitaker
151870cc0b Display enabled CPUs as a scrollable list in the config menu.
This removes a constraint on the number of CPU cores we can support.
2022-01-30 15:12:04 +00:00
Martin Whitaker
ed02a3baef Support display of more than 32 CPU cores in the config menu. 2022-01-29 16:00:33 +00:00
Martin Whitaker
4791206bbd Use consistent CPU sequencing mode abbreviations in config menu. 2022-01-28 21:57:39 +00:00
Martin Whitaker
4400ec6f17 Rename usbkbd to usbhcd to better reflect the new design. 2022-01-08 23:14:50 +00:00
Martin Whitaker
733919966d Add support for boot command line options. 2021-12-23 14:08:02 +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
27c5fe363f Add startup option to enable/disable SMP. 2020-12-10 13:51:39 +00:00
Martin Whitaker
808cd46582 Enable entry of address limits greater than 4GB on 32-bit build. 2020-05-29 20:42:26 +01:00
Martin Whitaker
fbd3376668 Initial commit. 2020-05-24 21:30:55 +01:00