mirror of
https://github.com/memtest86plus/memtest86plus.git
synced 2025-02-25 18:55:23 -06:00
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).
This commit is contained in:
parent
d0399fd287
commit
186ef6e913
@ -483,8 +483,9 @@ selected by the user.
|
|||||||
|
|
||||||
### Test 2 : Address test, own address + window
|
### Test 2 : Address test, own address + window
|
||||||
|
|
||||||
Across all memory regions, each address is written with its own address plus
|
Across all memory regions, each address is written with its own virtual
|
||||||
the window number and then each address is checked for consistency. This
|
address plus the window number (for 32-bit images) or own physical address
|
||||||
|
(for 64-bit images) and then each address is checked for consistency. This
|
||||||
catches any errors in the high order address bits that would be missed when
|
catches any errors in the high order address bits that would be missed when
|
||||||
testing each window in turn. This test is performed sequentially with each
|
testing each window in turn. This test is performed sequentially with each
|
||||||
available CPU, regardless of the CPU sequencing mode selected by the user.
|
available CPU, regardless of the CPU sequencing mode selected by the user.
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "vmem.h"
|
||||||
|
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
@ -127,12 +129,20 @@ int test_own_addr1(int my_cpu)
|
|||||||
|
|
||||||
int test_own_addr2(int my_cpu, int stage)
|
int test_own_addr2(int my_cpu, int stage)
|
||||||
{
|
{
|
||||||
static testword_t offset = 0;
|
|
||||||
static int last_stage = -1;
|
|
||||||
|
|
||||||
int ticks = 0;
|
int ticks = 0;
|
||||||
|
|
||||||
offset = (stage == last_stage) ? offset + 1 : 1;
|
testword_t offset;
|
||||||
|
|
||||||
|
// Calculate the offset (in pages) between the virtual address and the physical address.
|
||||||
|
offset = (vm_map[0].pm_base_addr / VM_WINDOW_SIZE) * VM_WINDOW_SIZE;
|
||||||
|
offset = (offset >= VM_PINNED_SIZE) ? offset - VM_PINNED_SIZE : 0;
|
||||||
|
#ifdef __x86_64__
|
||||||
|
// Convert to a byte address offset. This will translate the virtual address into a physical address.
|
||||||
|
offset *= PAGE_SIZE;
|
||||||
|
#else
|
||||||
|
// Convert to a VM window offset. This will get added into the LSBs of the virtual address.
|
||||||
|
offset /= VM_WINDOW_SIZE;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -145,6 +155,5 @@ int test_own_addr2(int my_cpu, int stage)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_stage = stage;
|
|
||||||
return ticks;
|
return ticks;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
test_pattern_t test_list[NUM_TEST_PATTERNS] = {
|
test_pattern_t test_list[NUM_TEST_PATTERNS] = {
|
||||||
// ena, cpu, stgs, itrs, errs, description
|
// ena, cpu, stgs, itrs, errs, description
|
||||||
{ true, SEQ, 1, 6, 0, "[Address test, walking ones, no cache] "},
|
{ true, SEQ, 1, 6, 0, "[Address test, walking ones, no cache] "},
|
||||||
{ true, SEQ, 1, 6, 0, "[Address test, own address in window] "},
|
{false, SEQ, 1, 6, 0, "[Address test, own address in window] "},
|
||||||
{ true, SEQ, 2, 6, 0, "[Address test, own address + window] "},
|
{ true, SEQ, 2, 6, 0, "[Address test, own address + window] "},
|
||||||
{ true, PAR, 1, 6, 0, "[Moving inversions, 1s & 0s] "},
|
{ true, PAR, 1, 6, 0, "[Moving inversions, 1s & 0s] "},
|
||||||
{ true, PAR, 1, 3, 0, "[Moving inversions, 8 bit pattern] "},
|
{ true, PAR, 1, 3, 0, "[Moving inversions, 8 bit pattern] "},
|
||||||
|
Loading…
Reference in New Issue
Block a user