]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Aug 2017 16:21:06 +0000 (09:21 -0700)
commit40b20d4ebd955a6be1fde47a54cc7f8173d54968
treeca4bedc7be17fdba6415b4d0b75a531b616ca6b5
parenta873b148ebfb24efb6fd5873dc7951d4f03cd1a6
parisc: Prevent TLB speculation on flushed pages on CPUs that only support equivalent aliases

commit ae7a609c34b6fb12328c553b5f9aab26ae74a28e upstream.

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>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/kernel/cache.c