diff options
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 797f9f107cb6..e17efed088c5 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -153,7 +153,7 @@ static void __cpa_flush_all(void *arg) | |||
153 | */ | 153 | */ |
154 | __flush_tlb_all(); | 154 | __flush_tlb_all(); |
155 | 155 | ||
156 | if (cache && boot_cpu_data.x86_model >= 4) | 156 | if (cache && boot_cpu_data.x86 >= 4) |
157 | wbinvd(); | 157 | wbinvd(); |
158 | } | 158 | } |
159 | 159 | ||
@@ -208,20 +208,15 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache, | |||
208 | int in_flags, struct page **pages) | 208 | int in_flags, struct page **pages) |
209 | { | 209 | { |
210 | unsigned int i, level; | 210 | unsigned int i, level; |
211 | unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */ | ||
211 | 212 | ||
212 | BUG_ON(irqs_disabled()); | 213 | BUG_ON(irqs_disabled()); |
213 | 214 | ||
214 | on_each_cpu(__cpa_flush_range, NULL, 1); | 215 | on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1); |
215 | 216 | ||
216 | if (!cache) | 217 | if (!cache || do_wbinvd) |
217 | return; | 218 | return; |
218 | 219 | ||
219 | /* 4M threshold */ | ||
220 | if (numpages >= 1024) { | ||
221 | if (boot_cpu_data.x86_model >= 4) | ||
222 | wbinvd(); | ||
223 | return; | ||
224 | } | ||
225 | /* | 220 | /* |
226 | * We only need to flush on one CPU, | 221 | * We only need to flush on one CPU, |
227 | * clflush is a MESI-coherent instruction that | 222 | * clflush is a MESI-coherent instruction that |