]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
parisc: Prevent TLB speculation on flushed pages on CPUs that only support equivalent...
authorJohn David Anglin <dave.anglin@bell.net>
Tue, 25 Jul 2017 21:11:26 +0000 (17:11 -0400)
committerHelge Deller <deller@gmx.de>
Tue, 25 Jul 2017 21:36:53 +0000 (23:36 +0200)
commitae7a609c34b6fb12328c553b5f9aab26ae74a28e
tree83a8ff3a784d77197e6da678831b9db683cac99a
parent56188832a50f09998cb570ba3771a1d25c193c0e
parisc: Prevent TLB speculation on flushed pages on CPUs that only support equivalent aliases

Helge noticed that we flush the TLB page in flush_cache_page but not in
flush_cache_range or flush_cache_mm.

For a long time, we have had random segmentation faults building
packages on machines with PA8800/8900 processors.  These machines only
support equivalent aliases.  We don't see these faults on machines that
don't require strict coherency.  So, it appears TLB speculation
sometimes leads to cache corruption on machines that require coherency.

This patch adds TLB flushes to flush_cache_range and flush_cache_mm when
coherency is required.  We only flush the TLB in flush_cache_page when
coherency is required.

The patch also optimizes flush_cache_range.  It turns out we always have
the right context to use flush_user_dcache_range_asm and
flush_user_icache_range_asm.

The patch has been tested for some time on rp3440, rp3410 and A500-44.
It's been boot tested on c8000.  No random segmentation faults were
observed during testing.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org # 4.9+
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/cache.c