Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43045
b: refs/heads/master
c: 3760dd6
h: refs/heads/master
i:
  43043: f18f1ff
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Dec 7, 2006
1 parent 6fbfb0d commit af3b55b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 770d132f03ac15b12919f1bac481f4beda13e094
refs/heads/master: 3760dd6efa75c98e223643da2eb7040406433053
24 changes: 17 additions & 7 deletions trunk/arch/i386/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot,
return base;
}

static void flush_kernel_map(void *dummy)
static void flush_kernel_map(void *arg)
{
/* Could use CLFLUSH here if the CPU supports it (Hammer,P4) */
if (boot_cpu_data.x86_model >= 4)
unsigned long adr = (unsigned long)arg;

if (adr && cpu_has_clflush) {
int i;
for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size)
asm volatile("clflush (%0)" :: "r" (adr + i));
} else if (boot_cpu_data.x86_model >= 4)
wbinvd();

/* Flush all to work around Errata in early athlons regarding
* large page flushing.
*/
Expand Down Expand Up @@ -173,9 +179,9 @@ __change_page_attr(struct page *page, pgprot_t prot)
return 0;
}

static inline void flush_map(void)
static inline void flush_map(void *adr)
{
on_each_cpu(flush_kernel_map, NULL, 1, 1);
on_each_cpu(flush_kernel_map, adr, 1, 1);
}

/*
Expand Down Expand Up @@ -217,9 +223,13 @@ void global_flush_tlb(void)
spin_lock_irq(&cpa_lock);
list_replace_init(&df_list, &l);
spin_unlock_irq(&cpa_lock);
flush_map();
list_for_each_entry_safe(pg, next, &l, lru)
if (!cpu_has_clflush)
flush_map(0);
list_for_each_entry_safe(pg, next, &l, lru) {
if (cpu_has_clflush)
flush_map(page_address(pg));
__free_page(pg);
}
}

#ifdef CONFIG_DEBUG_PAGEALLOC
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-i386/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
#define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN)
#define cpu_has_ds boot_cpu_has(X86_FEATURE_DS)
#define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS)
#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)

#endif /* __ASM_I386_CPUFEATURE_H */

Expand Down

0 comments on commit af3b55b

Please sign in to comment.