Commit cd86a536 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-fixes-for-linus' of...

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
parents ebd4c994 2171787b
...@@ -504,8 +504,11 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym)) ...@@ -504,8 +504,11 @@ static void walk_relocs(void (*visit)(Elf32_Rel *rel, Elf32_Sym *sym))
if (sym->st_shndx == SHN_ABS) { if (sym->st_shndx == SHN_ABS) {
continue; continue;
} }
if (r_type == R_386_PC32) { if (r_type == R_386_NONE || r_type == R_386_PC32) {
/* PC relative relocations don't need to be adjusted */ /*
* NONE can be ignored and and PC relative
* relocations don't need to be adjusted.
*/
} }
else if (r_type == R_386_32) { else if (r_type == R_386_32) {
/* Visit relocations that need to be adjusted */ /* Visit relocations that need to be adjusted */
......
...@@ -204,30 +204,19 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache) ...@@ -204,30 +204,19 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
} }
} }
static void wbinvd_local(void *unused)
{
wbinvd();
}
static void cpa_flush_array(unsigned long *start, int numpages, int cache, static void cpa_flush_array(unsigned long *start, int numpages, int cache,
int in_flags, struct page **pages) int in_flags, struct page **pages)
{ {
unsigned int i, level; unsigned int i, level;
unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
BUG_ON(irqs_disabled()); BUG_ON(irqs_disabled());
on_each_cpu(__cpa_flush_range, NULL, 1); on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
if (!cache) if (!cache || do_wbinvd)
return; return;
/* 4M threshold */
if (numpages >= 1024) {
if (boot_cpu_data.x86 >= 4)
on_each_cpu(wbinvd_local, NULL, 1);
return;
}
/* /*
* We only need to flush on one CPU, * We only need to flush on one CPU,
* clflush is a MESI-coherent instruction that * clflush is a MESI-coherent instruction that
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment