diff options
author | Regia König | 2021-08-05 18:50:15 +0200 |
---|---|---|
committer | Regia König | 2021-08-05 18:50:15 +0200 |
commit | 4fe002992433afd1d6cb66d07051e688617eba8a (patch) | |
tree | ac105f0c8bc97df8ae57ad1c142be2eb335ea99e /efi_memtest | |
parent | Move self_test into bios dir (diff) | |
download | memtest86-4fe002992433afd1d6cb66d07051e688617eba8a.tar.gz memtest86-4fe002992433afd1d6cb66d07051e688617eba8a.tar.xz memtest86-4fe002992433afd1d6cb66d07051e688617eba8a.zip |
Mark and outcomment all parts related to smp
Diffstat (limited to 'efi_memtest')
-rw-r--r-- | efi_memtest/memtest86+/efi/display.c | 13 | ||||
-rw-r--r-- | efi_memtest/memtest86+/efi/init.c | 7 | ||||
-rw-r--r-- | efi_memtest/memtest86+/efi/test.c | 19 | ||||
-rw-r--r-- | efi_memtest/memtest86+/error.c | 79 | ||||
-rw-r--r-- | efi_memtest/memtest86+/main.c | 203 | ||||
-rw-r--r-- | efi_memtest/memtest86+/random.c | 38 |
6 files changed, 289 insertions, 70 deletions
diff --git a/efi_memtest/memtest86+/efi/display.c b/efi_memtest/memtest86+/efi/display.c index 10a6b6f..8e0d9bf 100644 --- a/efi_memtest/memtest86+/efi/display.c +++ b/efi_memtest/memtest86+/efi/display.c @@ -3,7 +3,12 @@ #include "test.h" #include "logger.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" + #include "cpuid.h" /********************** @@ -12,7 +17,11 @@ //extern volatile short btflag; extern EFI_SYSTEM_TABLE *gST; -extern struct barrier_s *barr; + +/******************* + * TODO_SMP + ******************/ +//extern struct barrier_s *barr; #define CONSOLE_WIDTH 80 #define X_OFFSET 10 diff --git a/efi_memtest/memtest86+/efi/init.c b/efi_memtest/memtest86+/efi/init.c index 920586c..1d2f9a3 100644 --- a/efi_memtest/memtest86+/efi/init.c +++ b/efi_memtest/memtest86+/efi/init.c @@ -16,7 +16,12 @@ #include "defs.h" #include "config.h" #include "cpuid.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" + #include "io.h" #include "spd.h" #include "pci.h" diff --git a/efi_memtest/memtest86+/efi/test.c b/efi_memtest/memtest86+/efi/test.c index 9558582..ae05608 100644 --- a/efi_memtest/memtest86+/efi/test.c +++ b/efi_memtest/memtest86+/efi/test.c @@ -13,7 +13,12 @@ #include "config.h" #include "stdint.h" #include "cpuid.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" + #include "io.h" #include "logger.h" @@ -1651,12 +1656,20 @@ void block_move(int iter, int me) /* Initialize memory with the initial pattern. */ sliced_foreach_segment(&ctx, me, block_move_init); { BAILR } - s_barrier(); + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); /* Now move the data around */ sliced_foreach_segment(&ctx, me, block_move_move); { BAILR } - s_barrier(); + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); /* And check it. */ sliced_foreach_segment(&ctx, me, block_move_check); diff --git a/efi_memtest/memtest86+/error.c b/efi_memtest/memtest86+/error.c index f2e4227..3bf0dad 100644 --- a/efi_memtest/memtest86+/error.c +++ b/efi_memtest/memtest86+/error.c @@ -8,7 +8,12 @@ #include "test.h" #include "config.h" #include "cpuid.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" + #include "dmi.h" #include "controller.h" #include "logger.h" @@ -22,7 +27,12 @@ extern int dmi_err_cnts[MAX_DMI_MEMDEVS]; extern int beepmode; extern short dmi_initialized; extern struct cpu_ident cpu_id; -extern struct barrier_s *barr; + +/******************* + * TODO_SMP + ******************/ +//extern struct barrier_s *barr; + extern int test_ticks, nticks; extern struct tseq tseq[]; extern volatile int test; @@ -49,7 +59,11 @@ static void paint_line(int msg_line, unsigned vga_color) { * Report an assertion failure. This is typically NOT a memory error. */ void assert_fail(const char* file, int line_no) { - spin_lock(&barr->mutex); + +/******************* + * TODO_SMP + ******************/ + //spin_lock(&barr->mutex); scroll(); cprint(vv->msg_line, 0, " *** INTERNAL ERROR *** line "); @@ -57,7 +71,10 @@ void assert_fail(const char* file, int line_no) { cprint(vv->msg_line, 37, file); paint_line(vv->msg_line, 0x0E /* yellow on black */); - spin_unlock(&barr->mutex); +/******************* + * TODO_SMP + ******************/ + //spin_unlock(&barr->mutex); // Ensure the message remains visible for a while // before it scrolls away. Assert-fails should be rare @@ -72,7 +89,10 @@ void mt86_error(ulong *adr, ulong good, ulong bad) { ulong xor; - spin_lock(&barr->mutex); +/******************* + * TODO_SMP + ******************/ + //spin_lock(&barr->mutex); xor = good ^ bad; @@ -88,7 +108,11 @@ void mt86_error(ulong *adr, ulong good, ulong bad) #endif common_err(adr, good, bad, xor, 0); - spin_unlock(&barr->mutex); + +/******************* + * TODO_SMP + ******************/ + //spin_unlock(&barr->mutex); } /* @@ -98,9 +122,18 @@ void mt86_error(ulong *adr, ulong good, ulong bad) */ void ad_err1(ulong *adr1, ulong *mask, ulong bad, ulong good) { - spin_lock(&barr->mutex); + +/******************* + * TODO_SMP + ******************/ + //spin_lock(&barr->mutex); + common_err(adr1, good, bad, (ulong)mask, 1); - spin_unlock(&barr->mutex); + +/******************* + * TODO_SMP + ******************/ + //spin_unlock(&barr->mutex); } /* @@ -134,14 +167,22 @@ void ad_err2(ulong *adr, ulong bad) //query_memory_table(); // TODO remove //print_pmap(); // TODO remove +/******************* + * TODO_SMP + ******************/ // spin_lock(&barr->mutex); /*if (logflag) { print_log("ad_err2(): after spin_lock", 26); }*/ + common_err(adr, (ulong)adr, bad, ((ulong)adr) ^ bad, 0); /*if (logflag) { print_log("ad_err2(): common_err finished.", 31); }*/ + +/******************* + * TODO_SMP + ******************/ // spin_unlock(&barr->mutex); }__attribute__((used)) @@ -502,7 +543,12 @@ void printpatn (void) /* * Show progress by displaying elapsed time and update bar graphs */ -short spin_idx[MAX_CPUS]; +/******************* + * TODO_SMP + ******************/ +//short spin_idx[MAX_CPUS]; +short spin_idx; // TODO remove + char spin[4] = {'|','/','-','\\'}; void do_tick(int me) @@ -511,9 +557,16 @@ void do_tick(int me) ulong h, /*l,*/ n/*, t*/; extern int mstr_cpu; - if (++spin_idx[me] > 3) { +/******************* + * TODO_SMP + ******************/ +/* if (++spin_idx[me] > 3) { spin_idx[me] = 0; - } + }*/ + if (++spin_idx > 3) { + spin_idx = 0; + } // TODO remove + //cplace(8, me+7, spin[spin_idx[me]]); @@ -521,6 +574,10 @@ void do_tick(int me) if (me == mstr_cpu) { check_input(); } + +/******************* + * TODO_SMP + ******************/ /* A barrier here holds the other CPUs until the configuration * changes are done */ //s_barrier(); diff --git a/efi_memtest/memtest86+/main.c b/efi_memtest/memtest86+/main.c index c7678bd..57a8b8d 100644 --- a/efi_memtest/memtest86+/main.c +++ b/efi_memtest/memtest86+/main.c @@ -14,7 +14,12 @@ #include "test.h" #include "defs.h" #include "cpuid.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" + #include "config.h" #include "logger.h" #include "display.h" @@ -42,7 +47,12 @@ extern void initialise_cpus(); extern ulong rand(int cpu); extern void get_mem_speed(int cpu, int ncpus); extern void rand_seed(unsigned int seed1, unsigned int seed2, int cpu); -extern struct barrier_s *barr; + +/******************* + * TODO_SMP + ******************/ +//extern struct barrier_s *barr; + extern int num_cpus; extern int act_cpus; extern void clear_screen(void); @@ -82,10 +92,20 @@ struct tseq tseq[] = volatile int mstr_cpu; volatile int run_cpus; volatile int cpu_ord=0; -int maxcpus=MAX_CPUS; + +/******************* + * TODO_SMP + ******************/ +//int maxcpus=MAX_CPUS; + volatile short cpu_sel; volatile short cpu_mode; -char cpu_mask[MAX_CPUS]; + +/******************* + * TODO_SMP + ******************/ +//char cpu_mask[MAX_CPUS]; + long bin_mask=0xffffffff; //short onepass; //TODO @@ -96,7 +116,12 @@ long bin_mask=0xffffffff; volatile int test; short restart_flag; -uint8_t volatile stacks[MAX_CPUS][STACKSIZE_BYTES]; + +/******************* + * TODO_SMP + ******************/ +//uint8_t volatile stacks[MAX_CPUS][STACKSIZE_BYTES]; + int bitf_seq = 0; char cmdline_parsed = 0; struct vars variables = {}; @@ -224,7 +249,9 @@ void set_defaults() } } - +/******************* + * TODO_RELOCATION + ******************/ /* Relocate the test to a new address. Be careful to not overlap! */ /*static void run_at(unsigned long addr, int cpu) { @@ -235,6 +262,9 @@ void set_defaults() mt86_memmove((void *)addr, &_start, _end - _start); }*/ +/******************* + * TODO_SMP + ******************/ /* Wait for the copy */ /* barrier();*/ @@ -246,6 +276,9 @@ void set_defaults() /* goto *ja; }*/ +/******************* + * TODO_SMP + ******************/ /* Switch from the boot stack to the main stack. First the main stack * is allocated, then the contents of the boot stack are copied, then * ESP is adjusted to point to the new stack. @@ -433,8 +466,11 @@ void test_start(void) print_log(s, sizeof(s)); } +/******************* + * TODO_SMP + ******************/ my_cpu_ord = cpu_ord++; - smp_set_ordinal(my_cpu_num, my_cpu_ord); + //smp_set_ordinal(my_cpu_num, my_cpu_ord); if (logflag) { char log[37] = "test_start(): my_cpu_ord = "; @@ -447,9 +483,12 @@ void test_start(void) if (logflag) print_log("test_start(): Command line parsed, now clear_screen()", 53); +/******************* + * TODO_SMP + ******************/ /* Initialize the barrier so the lock in btrace will work. * Will get redone later when we know how many CPUs we have */ - barrier_init(1); + //barrier_init(1); /********************** * TODO_BOOTTRACE @@ -556,13 +595,15 @@ void test_start(void) *********************/ //btrace(my_cpu_num, __LINE__, "AP_Start ", 0, my_cpu_num, cpu_ord); - - smp_ap_booted(my_cpu_num); +/******************* + * TODO_SMP + ******************/ + //smp_ap_booted(my_cpu_num); /* Asign a sequential CPU ordinal to each active cpu */ - spin_lock(&barr->mutex); + /*spin_lock(&barr->mutex); my_cpu_ord = cpu_ord++; smp_set_ordinal(my_cpu_num, my_cpu_ord); - spin_unlock(&barr->mutex); + spin_unlock(&barr->mutex);*/ /********************** @@ -572,10 +613,13 @@ void test_start(void) } } else { +/******************* + * TODO_SMP + ******************/ /* Unlock after a relocation */ - spin_unlock(&barr->mutex); + //spin_unlock(&barr->mutex); /* Get the CPU ordinal since it is lost during relocation */ - my_cpu_ord = smp_my_ord_num(my_cpu_num); + //my_cpu_ord = smp_my_ord_num(my_cpu_num); /********************** * TODO_BOOTTRACE @@ -583,8 +627,11 @@ void test_start(void) //btrace(my_cpu_num, __LINE__, "Reloc_Done",0,my_cpu_num,my_cpu_ord); } +/******************* + * TODO_SMP + ******************/ /* A barrier to insure that all of the CPUs are done with startup */ - barrier(); + //barrier(); /********************** * TODO_BOOTTRACE @@ -683,7 +730,10 @@ void test_start(void) //btrace(my_cpu_num, __LINE__, "Sched_Barr", 1,window,win_next); - barrier(); +/******************* + * TODO_SMP + ******************/ + //barrier(); /* Don't go over the 8TB PAE limit */ if (win_next > MAX_MEM_PAGES) { @@ -696,6 +746,10 @@ void test_start(void) window = 1; } + +/******************* + * TODO_RELOCATION + ******************/ /* Relocate if required */ /*if (window != 0 && (ulong)&_start != LOW_TEST_ADR) { btrace(my_cpu_num, __LINE__, "Sched_RelL", 1,0,0); @@ -779,17 +833,26 @@ void test_start(void) * TODO_BOOTTRACE *********************/ //btrace(my_cpu_num, __LINE__, "Sched_CPU1",1,run_cpus,run); - - barrier(); - dprint(9, 7, run_cpus, 2, 0); - + + /******************* + * TODO_SMP + ******************/ +/* barrier(); + dprint(9, 7, run_cpus, 2, 0);*/ + +/******************* + * TODO_SMP + ******************/ /* Setup a sub barrier for only the selected CPUs */ - if (my_cpu_ord == mstr_cpu) { +/* if (my_cpu_ord == mstr_cpu) { s_barrier_init(run_cpus); - } + }*/ +/******************* + * TODO_SMP + ******************/ /* Make sure the the sub barrier is ready before proceeding */ - barrier(); + //barrier(); /* Not selected CPUs go back to the scheduling barrier */ if (logflag && log_fine) { @@ -868,7 +931,10 @@ void test_start(void) } } - s_barrier(); +/******************* + * TODO_SMP + ******************/ + //s_barrier(); /********************** * TODO_BOOTTRACE @@ -912,7 +978,10 @@ void test_start(void) print_log("test_start(): End of window loop.", 33); } - s_barrier(); +/******************* + * TODO_SMP + ******************/ + //s_barrier(); /********************** * TODO_BOOTTRACE @@ -1186,9 +1255,14 @@ int do_test(int my_ord) case 4: /* Moving inversions, all ones and zeros (tests #3, 4) */ if(logflag) print_log("do_test(): Run test # 4\n", 23); /*p1 = 0; - p2 = ~p1; - s_barrier(); - movinv1(c_iter,p1,p2,my_ord); + p2 = ~p1;*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinv1(c_iter,p1,p2,my_ord); BAILOUT;*/ /* Switch patterns */ @@ -1202,14 +1276,24 @@ int do_test(int my_ord) /*p0 = 0x80; for (i=0; i<8; i++, p0=p0>>1) { p1 = p0 | (p0<<8) | (p0<<16) | (p0<<24); - p2 = ~p1; - s_barrier(); - movinv1(c_iter,p1,p2, my_ord); + p2 = ~p1;*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinv1(c_iter,p1,p2, my_ord); BAILOUT;*/ /* Switch patterns */ - /*s_barrier(); - movinv1(c_iter,p2,p1, my_ord); + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinv1(c_iter,p2,p1, my_ord); BAILOUT; }*/ break; @@ -1232,9 +1316,14 @@ int do_test(int my_ord) if (my_ord == mstr_cpu) { sp1 = rand(0); sp2 = ~p1; - } - s_barrier(); - movinv1(2,sp1,sp2, my_ord); + }*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinv1(2,sp1,sp2, my_ord); BAILOUT; }*/ break; @@ -1248,9 +1337,14 @@ int do_test(int my_ord) case 8: /* Moving inversions, 32 bit shifting pattern (test #8) */ if(logflag) print_log("do_test(): Run test # 8\n", 23); - /*for (i=0, p1=1; p1; p1=p1<<1, i++) { - s_barrier(); - movinv32(c_iter,p1, 1, 0x80000000, 0, i, my_ord); + /*for (i=0, p1=1; p1; p1=p1<<1, i++) {*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinv32(c_iter,p1, 1, 0x80000000, 0, i, my_ord); { BAILOUT } s_barrier(); movinv32(c_iter,~p1, 0xfffffffe, @@ -1261,9 +1355,14 @@ int do_test(int my_ord) case 9: /* Random Data Sequence (test #9) */ if(logflag) print_log("do_test(): Run test # 9\n", 23); - /*for (i=0; i < c_iter; i++) { - s_barrier(); - movinvr(my_ord); + /*for (i=0; i < c_iter; i++) {*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*movinvr(my_ord); BAILOUT; }*/ break; @@ -1273,14 +1372,24 @@ int do_test(int my_ord) /*for (j=0; j<c_iter; j++) { p1 = rand(0); for (i=0; i<MOD_SZ; i++) { - p2 = ~p1; - s_barrier(); - modtst(i, 2, p1, p2, my_ord); + p2 = ~p1;*/ + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*modtst(i, 2, p1, p2, my_ord); BAILOUT;*/ /* Switch patterns */ - /*s_barrier(); - modtst(i, 2, p2, p1, my_ord); + +/******************* + * TODO_SMP + ******************/ + //s_barrier(); + + /*modtst(i, 2, p2, p1, my_ord); BAILOUT; } }*/ diff --git a/efi_memtest/memtest86+/random.c b/efi_memtest/memtest86+/random.c index 69dd140..f400de4 100644 --- a/efi_memtest/memtest86+/random.c +++ b/efi_memtest/memtest86+/random.c @@ -6,16 +6,31 @@ /******************************************************************/ #include "stdint.h" #include "cpuid.h" -#include "smp.h" + +/******************* + * TODO_SMP + ******************/ +//#include "smp.h" /* Keep a separate seed for each CPU */ /* Space the seeds by at least a cache line or performance suffers big time! */ -static unsigned int SEED_X[MAX_CPUS*16]; -static unsigned int SEED_Y[MAX_CPUS*16]; + +/******************* + * TODO_SMP + ******************/ +/*static unsigned int SEED_X[MAX_CPUS*16]; +static unsigned int SEED_Y[MAX_CPUS*16];*/ +static unsigned int SEED_X; +static unsigned int SEED_Y; unsigned long rand (int cpu) { static unsigned int a = 18000, b = 30903; + +/******************* + * TODO_SMP + ******************/ +/* int me; me = cpu*16; @@ -23,16 +38,27 @@ unsigned long rand (int cpu) SEED_X[me] = a*(SEED_X[me]&65535) + (SEED_X[me]>>16); SEED_Y[me] = b*(SEED_Y[me]&65535) + (SEED_Y[me]>>16); - return ((SEED_X[me]<<16) + (SEED_Y[me]&65535)); + return ((SEED_X[me]<<16) + (SEED_Y[me]&65535));*/ + + SEED_X = a*(SEED_X&65535) + (SEED_X>>16); + SEED_Y = b*(SEED_Y&65535) + (SEED_Y>>16); + + return ((SEED_X<<16) + (SEED_Y&65535)); } void rand_seed( unsigned int seed1, unsigned int seed2, int cpu) { - int me; +/******************* + * TODO_SMP + ******************/ +/* int me; me = cpu*16; SEED_X[me] = seed1; - SEED_Y[me] = seed2; + SEED_Y[me] = seed2;*/ + + SEED_X = seed1; + SEED_Y = seed2; } |