diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2014-02-26 14:06:50 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2014-02-27 11:26:10 -0500 |
commit | 8b80fd8b45458a7d0b726d454c51c5219e0fb2ee (patch) | |
tree | cdff4e4cb0156bb0304be33ec1c4513f22687ccf /arch/x86/mm/pageattr.c | |
parent | 171699f7630c92d0a928f83e5fb3aeabe35398c0 (diff) |
x86: Use clflushopt in clflush_cache_range
If clflushopt is available on the system, use it instead of clflush in
clflush_cache_range.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Link: http://lkml.kernel.org/r/1393441612-19729-3-git-send-email-ross.zwisler@linux.intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index b3b19f46c016..b1c46723b19b 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -126,8 +126,8 @@ within(unsigned long addr, unsigned long start, unsigned long end) | |||
126 | * @vaddr: virtual start address | 126 | * @vaddr: virtual start address |
127 | * @size: number of bytes to flush | 127 | * @size: number of bytes to flush |
128 | * | 128 | * |
129 | * clflush is an unordered instruction which needs fencing with mfence | 129 | * clflushopt is an unordered instruction which needs fencing with mfence or |
130 | * to avoid ordering issues. | 130 | * sfence to avoid ordering issues. |
131 | */ | 131 | */ |
132 | void clflush_cache_range(void *vaddr, unsigned int size) | 132 | void clflush_cache_range(void *vaddr, unsigned int size) |
133 | { | 133 | { |
@@ -136,11 +136,11 @@ void clflush_cache_range(void *vaddr, unsigned int size) | |||
136 | mb(); | 136 | mb(); |
137 | 137 | ||
138 | for (; vaddr < vend; vaddr += boot_cpu_data.x86_clflush_size) | 138 | for (; vaddr < vend; vaddr += boot_cpu_data.x86_clflush_size) |
139 | clflush(vaddr); | 139 | clflushopt(vaddr); |
140 | /* | 140 | /* |
141 | * Flush any possible final partial cacheline: | 141 | * Flush any possible final partial cacheline: |
142 | */ | 142 | */ |
143 | clflush(vend); | 143 | clflushopt(vend); |
144 | 144 | ||
145 | mb(); | 145 | mb(); |
146 | } | 146 | } |