parisc: Ensure volatile space register %sr1 is not clobbered
authorJohn David Anglin <dave.anglin@bell.net>
Sat, 29 Jun 2013 20:42:12 +0000 (16:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jul 2013 01:21:26 +0000 (18:21 -0700)
commitad5def802da90a988d243d8426478bf23f54aad0
tree6aac5c9ba7c7fb2b210d5f3261e1e77273614fac
parent002b98a8495089379af21689688ad575d90bd8d4
parisc: Ensure volatile space register %sr1 is not clobbered

commit e8d8fc219f9a0e63e7fb927881e6f4db8e7d34df upstream.

I still see the occasional random segv on rp3440.  Looking at one of
these (a code 15), it appeared the problem must be with the cache
handling of anonymous pages.  Reviewing this, I noticed that the space
register %sr1 might be being clobbered when we flush an anonymous page.

Register %sr1 is used for TLB purges in a couple of places.  These
purges are needed on PA8800 and PA8900 processors to ensure cache
consistency of flushed cache lines.

The solution here is simply to move the %sr1 load into the TLB lock
region needed to ensure that one purge executes at a time on SMP
systems.  This was already the case for one use.  After a few days of
operation, I haven't had a random segv on my rp3440.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/include/asm/tlbflush.h
arch/parisc/kernel/cache.c