summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pageattr.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-01-12 11:08:13 +0100
committerIngo Molnar <mingo@kernel.org>2016-01-12 11:08:13 +0100
commitc0c57019a65341f08858541d2740b74dee821cf1 (patch)
tree584ac03f7dfa26c9c45c3d66ad306222e893fa33 /arch/x86/mm/pageattr.c
parent8c31902cffc4d716450be549c66a67a8a3dd479c (diff)
parentae8a52185e5c070cf4510b323dbc1b9e46b897d6 (diff)
downloadop-kernel-dev-c0c57019a65341f08858541d2740b74dee821cf1.zip
op-kernel-dev-c0c57019a65341f08858541d2740b74dee821cf1.tar.gz
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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index a3137a4..6000ad7 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();
OpenPOWER on IntegriCloud