aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/lib/cacheflush.c
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-07-23 17:32:04 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-07-31 11:51:19 -0400
commitdd78bc11fb2050b6a3990d0421feca4c68ca4335 (patch)
tree7147fe5e0b3815443eea608d3dd0950ba53bb47d /arch/tile/lib/cacheflush.c
parent7d937719e3c5c6c9ad00584f6b62230d2ef7f9f1 (diff)
tile: convert uses of "inv" to "finv"
The "inv" (invalidate) instruction is generally less safe than "finv" (flush and invalidate), as it will drop dirty data from the cache. It turns out we have almost no need for "inv" (other than for the older 32-bit architecture in some limited cases), so convert to "finv" where possible and delete the extra "inv" infrastructure. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/lib/cacheflush.c')
-rw-r--r--arch/tile/lib/cacheflush.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/tile/lib/cacheflush.c b/arch/tile/lib/cacheflush.c
index 8f8ad814b139..2238b40abf3c 100644
--- a/arch/tile/lib/cacheflush.c
+++ b/arch/tile/lib/cacheflush.c
@@ -147,18 +147,21 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh)
147 force_load(p); 147 force_load(p);
148 148
149 /* 149 /*
150 * Repeat, but with inv's instead of loads, to get rid of the 150 * Repeat, but with finv's instead of loads, to get rid of the
151 * data we just loaded into our own cache and the old home L3. 151 * data we just loaded into our own cache and the old home L3.
152 * No need to unroll since inv's don't target a register. 152 * No need to unroll since finv's don't target a register.
153 * The finv's are guaranteed not to actually flush the data in
154 * the buffer back to their home, since we just read it, so the
155 * lines are clean in cache; we will only invalidate those lines.
153 */ 156 */
154 p = (char *)buffer + size - 1; 157 p = (char *)buffer + size - 1;
155 __insn_inv(p); 158 __insn_finv(p);
156 p -= step_size; 159 p -= step_size;
157 p = (char *)((unsigned long)p | (step_size - 1)); 160 p = (char *)((unsigned long)p | (step_size - 1));
158 for (; p >= base; p -= step_size) 161 for (; p >= base; p -= step_size)
159 __insn_inv(p); 162 __insn_finv(p);
160 163
161 /* Wait for the load+inv's (and thus finvs) to have completed. */ 164 /* Wait for these finv's (and thus the first finvs) to be done. */
162 __insn_mf(); 165 __insn_mf();
163 166
164#ifdef __tilegx__ 167#ifdef __tilegx__