]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: Purge TLB before setting PTE
authorJohn David Anglin <dave.anglin@bell.net>
Wed, 7 Dec 2016 02:47:04 +0000 (21:47 -0500)
committerHelge Deller <deller@gmx.de>
Wed, 7 Dec 2016 07:56:40 +0000 (08:56 +0100)
commitb9152ebe085d2e175a5e4bf4d85ee779996f2ffe
tree981210b6bafc21ba73f0ea3b2f5ac00f8b60a6b9
parente495dff613955b5466e9dda98d106a731ee21913
parisc: Purge TLB before setting PTE

The attached change interchanges the order of purging the TLB and
setting the corresponding page table entry.  TLB purges are strongly
ordered.  It occurred to me one night that setting the PTE first might
have subtle ordering issues on SMP machines and cause random memory
corruption.

A TLB lock guards the insertion of user TLB entries.  So after the TLB
is purged, a new entry can't be inserted until the lock is released.
This ensures that the new PTE value is used when the lock is released.

Since making this change, no random segmentation faults have been
observed on the Debian hppa buildd servers.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/pgtable.h