1 #include <linux/kernel.h>
2 #include <linux/errno.h>
3 #include <linux/string.h>
4 #include <linux/types.h>
13 0xffffffffffffffffULL,
14 0x5555555555555555ULL,
15 0xaaaaaaaaaaaaaaaaULL,
16 0x1111111111111111ULL,
17 0x2222222222222222ULL,
18 0x4444444444444444ULL,
19 0x8888888888888888ULL,
20 0x3333333333333333ULL,
21 0x6666666666666666ULL,
22 0x9999999999999999ULL,
23 0xccccccccccccccccULL,
24 0x7777777777777777ULL,
25 0xbbbbbbbbbbbbbbbbULL,
26 0xddddddddddddddddULL,
27 0xeeeeeeeeeeeeeeeeULL,
28 0x7a6c7258554e494cULL,
34 (
unsigned long long) pattern,
35 (
unsigned long long) start_bad,
36 (
unsigned long long) end_bad);
43 u64 start_bad, last_bad;
44 u64 start_phys_aligned;
45 const size_t incr =
sizeof(
pattern);
47 start_phys_aligned =
ALIGN(start_phys, incr);
48 start =
__va(start_phys_aligned);
49 end = start + (size - (start_phys_aligned - start_phys)) / incr;
56 for (
p =
start;
p <
end;
p++, start_phys_aligned += incr) {
59 if (start_phys_aligned == last_bad + incr) {
64 reserve_bad_mem(pattern, start_bad, last_bad + incr);
65 start_bad = last_bad = start_phys_aligned;
68 reserve_bad_mem(pattern, start_bad, last_bad + incr);
79 if (this_start < this_end) {
81 (
unsigned long long)this_start,
82 (
unsigned long long)this_end,
84 memtest(pattern, this_start, this_end - this_start);
92 static int __init parse_memtest(
char *
arg)
107 unsigned int idx = 0;
109 if (!memtest_pattern)
113 for (i = 0; i < memtest_pattern; i++) {
115 do_one_pass(patterns[idx], start, end);
120 "test pattern from memory\n");
122 do_one_pass(0, start, end);