diff options
author | Jack Steiner <steiner@sgi.com> | 2009-12-15 19:48:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 10:20:15 -0500 |
commit | 67bf04a5c2574e9495f660f418f6df776821d578 (patch) | |
tree | ff28ab4983b007136da88786c8966ea1598841a0 /drivers/misc/sgi-gru/grufault.c | |
parent | e006043a4d2da52bba9fd9cb7e5a22e2951ff69b (diff) |
gru: fix prefetch and speculation bugs
Fix several bugs related to prefetch, ordering & speculation:
- GRU cch_allocate() instruction causes cacheable memory
to be created. Add a barriers to prevent speculation
from prefetching data before it exists.
- Add memory barriers before cache-flush instructions to ensure
that previously stored data is included in the line flushed to memory.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grufault.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufault.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index 7466234450f3..d3cacd696b38 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c | |||
@@ -333,6 +333,7 @@ static int gru_try_dropin(struct gru_thread_state *gts, | |||
333 | */ | 333 | */ |
334 | if (tfh->status != TFHSTATUS_EXCEPTION) { | 334 | if (tfh->status != TFHSTATUS_EXCEPTION) { |
335 | gru_flush_cache(tfh); | 335 | gru_flush_cache(tfh); |
336 | sync_core(); | ||
336 | if (tfh->status != TFHSTATUS_EXCEPTION) | 337 | if (tfh->status != TFHSTATUS_EXCEPTION) |
337 | goto failnoexception; | 338 | goto failnoexception; |
338 | STAT(tfh_stale_on_fault); | 339 | STAT(tfh_stale_on_fault); |
@@ -599,6 +600,7 @@ int gru_get_exception_detail(unsigned long arg) | |||
599 | cbrnum = thread_cbr_number(gts, ucbnum); | 600 | cbrnum = thread_cbr_number(gts, ucbnum); |
600 | cbe = get_cbe_by_index(gts->ts_gru, cbrnum); | 601 | cbe = get_cbe_by_index(gts->ts_gru, cbrnum); |
601 | gru_flush_cache(cbe); /* CBE not coherent */ | 602 | gru_flush_cache(cbe); /* CBE not coherent */ |
603 | sync_core(); /* make sure we are have current data */ | ||
602 | excdet.opc = cbe->opccpy; | 604 | excdet.opc = cbe->opccpy; |
603 | excdet.exopc = cbe->exopccpy; | 605 | excdet.exopc = cbe->exopccpy; |
604 | excdet.ecause = cbe->ecause; | 606 | excdet.ecause = cbe->ecause; |