diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:09 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:09 -0500 |
commit | 86f03989d99cfa2e1216cdd7aa996852236909cf (patch) | |
tree | 6fae63f51c4adf08f94975b48e656b31c6bced62 /arch/x86/mm/pageattr-test.c | |
parent | aba8391f7323294e88e3a665513434aba4042a7d (diff) |
x86: cpa: fix the self-test
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pageattr-test.c')
-rw-r--r-- | arch/x86/mm/pageattr-test.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c index 554820265b95..06353d43f72e 100644 --- a/arch/x86/mm/pageattr-test.c +++ b/arch/x86/mm/pageattr-test.c | |||
@@ -15,8 +15,7 @@ | |||
15 | #include <asm/kdebug.h> | 15 | #include <asm/kdebug.h> |
16 | 16 | ||
17 | enum { | 17 | enum { |
18 | NTEST = 400, | 18 | NTEST = 4000, |
19 | LOWEST_LEVEL = PG_LEVEL_4K, | ||
20 | #ifdef CONFIG_X86_64 | 19 | #ifdef CONFIG_X86_64 |
21 | LPS = (1 << PMD_SHIFT), | 20 | LPS = (1 << PMD_SHIFT), |
22 | #elif defined(CONFIG_X86_PAE) | 21 | #elif defined(CONFIG_X86_PAE) |
@@ -59,10 +58,10 @@ static __init int print_split(struct split_state *s) | |||
59 | continue; | 58 | continue; |
60 | } | 59 | } |
61 | 60 | ||
62 | if (level == 2 && sizeof(long) == 8) { | 61 | if (level == PG_LEVEL_1G && sizeof(long) == 8) { |
63 | s->gpg++; | 62 | s->gpg++; |
64 | i += GPS/PAGE_SIZE; | 63 | i += GPS/PAGE_SIZE; |
65 | } else if (level != LOWEST_LEVEL) { | 64 | } else if (level == PG_LEVEL_2M) { |
66 | if (!(pte_val(*pte) & _PAGE_PSE)) { | 65 | if (!(pte_val(*pte) & _PAGE_PSE)) { |
67 | printk(KERN_ERR | 66 | printk(KERN_ERR |
68 | "%lx level %d but not PSE %Lx\n", | 67 | "%lx level %d but not PSE %Lx\n", |
@@ -162,7 +161,7 @@ static __init int exercise_pageattr(void) | |||
162 | continue; | 161 | continue; |
163 | } | 162 | } |
164 | 163 | ||
165 | err = __change_page_attr_clear(addr[i], len[i], | 164 | err = change_page_attr_clear(addr[i], len[i], |
166 | __pgprot(_PAGE_GLOBAL)); | 165 | __pgprot(_PAGE_GLOBAL)); |
167 | if (err < 0) { | 166 | if (err < 0) { |
168 | printk(KERN_ERR "CPA %d failed %d\n", i, err); | 167 | printk(KERN_ERR "CPA %d failed %d\n", i, err); |
@@ -175,7 +174,7 @@ static __init int exercise_pageattr(void) | |||
175 | pte ? (u64)pte_val(*pte) : 0ULL); | 174 | pte ? (u64)pte_val(*pte) : 0ULL); |
176 | failed++; | 175 | failed++; |
177 | } | 176 | } |
178 | if (level != LOWEST_LEVEL) { | 177 | if (level != PG_LEVEL_4K) { |
179 | printk(KERN_ERR "CPA %lx: unexpected level %d\n", | 178 | printk(KERN_ERR "CPA %lx: unexpected level %d\n", |
180 | addr[i], level); | 179 | addr[i], level); |
181 | failed++; | 180 | failed++; |
@@ -183,7 +182,6 @@ static __init int exercise_pageattr(void) | |||
183 | 182 | ||
184 | } | 183 | } |
185 | vfree(bm); | 184 | vfree(bm); |
186 | cpa_flush_all(); | ||
187 | 185 | ||
188 | failed += print_split(&sb); | 186 | failed += print_split(&sb); |
189 | 187 | ||
@@ -197,7 +195,7 @@ static __init int exercise_pageattr(void) | |||
197 | failed++; | 195 | failed++; |
198 | continue; | 196 | continue; |
199 | } | 197 | } |
200 | err = __change_page_attr_set(addr[i], len[i], | 198 | err = change_page_attr_set(addr[i], len[i], |
201 | __pgprot(_PAGE_GLOBAL)); | 199 | __pgprot(_PAGE_GLOBAL)); |
202 | if (err < 0) { | 200 | if (err < 0) { |
203 | printk(KERN_ERR "CPA reverting failed: %d\n", err); | 201 | printk(KERN_ERR "CPA reverting failed: %d\n", err); |
@@ -211,7 +209,6 @@ static __init int exercise_pageattr(void) | |||
211 | } | 209 | } |
212 | 210 | ||
213 | } | 211 | } |
214 | cpa_flush_all(); | ||
215 | 212 | ||
216 | failed += print_split(&sc); | 213 | failed += print_split(&sc); |
217 | 214 | ||