diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-01-12 13:08:13 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-01-12 13:08:13 +0300 |
commit | c0c57019a65341f08858541d2740b74dee821cf1 (patch) | |
tree | 584ac03f7dfa26c9c45c3d66ad306222e893fa33 /arch/x86/mm/pageattr.c | |
parent | 8c31902cffc4d716450be549c66a67a8a3dd479c (diff) | |
parent | ae8a52185e5c070cf4510b323dbc1b9e46b897d6 (diff) | |
download | linux-c0c57019a65341f08858541d2740b74dee821cf1.tar.xz |
Merge commit 'linus' into x86/urgent, to pick up recent x86 changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index a3137a4feed1..6000ad7f560c 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -129,14 +129,16 @@ within(unsigned long addr, unsigned long start, unsigned long end) */ void clflush_cache_range(void *vaddr, unsigned int size) { - unsigned long clflush_mask = boot_cpu_data.x86_clflush_size - 1; + const unsigned long clflush_size = boot_cpu_data.x86_clflush_size; + void *p = (void *)((unsigned long)vaddr & ~(clflush_size - 1)); void *vend = vaddr + size; - void *p; + + if (p >= vend) + return; mb(); - for (p = (void *)((unsigned long)vaddr & ~clflush_mask); - p < vend; p += boot_cpu_data.x86_clflush_size) + for (; p < vend; p += clflush_size) clflushopt(p); mb(); |