]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commit
[PARISC] prevent speculative re-read on cache flush
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 15 Apr 2011 17:37:22 +0000 (12:37 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Fri, 15 Apr 2011 17:55:56 +0000 (12:55 -0500)
commitb7d45818444a31948cfc7849136013a0ea54b2fb
treec24455fe3f41bffabb377fa9c855eaa7cac26a1e
parentd7dd2ff11b7fcd425aca5a875983c862d19a67ae
[PARISC] prevent speculative re-read on cache flush

According to Appendix F, the TLB is the primary arbiter of speculation.
Thus, if a page has a TLB entry, it may be speculatively read into the
cache.  On linux, this can cause us incoherencies because if we're about
to do a disk read, we call get_user_pages() to do the flush/invalidate
in user space, but we still potentially have the user TLB entries, and
the cache could speculate the lines back into userspace (thus causing
stale data to be used).  This is fixed by purging the TLB entries before
we flush through the tmpalias space.  Now, the only way the line could
be re-speculated is if the user actually tries to touch it (which is not
allowed).

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
arch/parisc/include/asm/cacheflush.h
arch/parisc/kernel/cache.c