Commit cd86a536c81e9300d984327517548ca0652eebf9

Authored by Linus Torvalds

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/…

…git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: avoid back to back on_each_cpu in cpa_flush_array
  x86, relocs: ignore R_386_NONE in kernel relocation entries

Showing 2 changed files Side-by-side Diff

arch/x86/boot/compressed/relocs.c
... ... @@ -504,8 +504,11 @@
504 504 if (sym->st_shndx == SHN_ABS) {
505 505 continue;
506 506 }
507   - if (r_type == R_386_PC32) {
508   - /* PC relative relocations don't need to be adjusted */
  507 + if (r_type == R_386_NONE || r_type == R_386_PC32) {
  508 + /*
  509 + * NONE can be ignored and and PC relative
  510 + * relocations don't need to be adjusted.
  511 + */
509 512 }
510 513 else if (r_type == R_386_32) {
511 514 /* Visit relocations that need to be adjusted */
arch/x86/mm/pageattr.c
... ... @@ -204,30 +204,19 @@
204 204 }
205 205 }
206 206  
207   -static void wbinvd_local(void *unused)
208   -{
209   - wbinvd();
210   -}
211   -
212 207 static void cpa_flush_array(unsigned long *start, int numpages, int cache,
213 208 int in_flags, struct page **pages)
214 209 {
215 210 unsigned int i, level;
  211 + unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
216 212  
217 213 BUG_ON(irqs_disabled());
218 214  
219   - on_each_cpu(__cpa_flush_range, NULL, 1);
  215 + on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
220 216  
221   - if (!cache)
  217 + if (!cache || do_wbinvd)
222 218 return;
223 219  
224   - /* 4M threshold */
225   - if (numpages >= 1024) {
226   - if (boot_cpu_data.x86 >= 4)
227   - on_each_cpu(wbinvd_local, NULL, 1);
228   -
229   - return;
230   - }
231 220 /*
232 221 * We only need to flush on one CPU,
233 222 * clflush is a MESI-coherent instruction that