]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s/radix: Fix missing ptesync in flush_cache_vmap
authorNicholas Piggin <npiggin@gmail.com>
Wed, 6 Jun 2018 01:40:08 +0000 (11:40 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 6 Jun 2018 08:50:53 +0000 (18:50 +1000)
commitce0ffe945e2865a3c817707f6f1d76d2611d6f51
tree3e9676c15faba79021a630df11f9913e0ef98547
parent2a048e093445802da19195e155615ab8cb8ef086
powerpc/64s/radix: Fix missing ptesync in flush_cache_vmap

There is a typo in c1a5e51b58 ("powerpc/64s/radix: avoid ptesync after
set_pte and ptep_set_access_flags") config ifdef, which results in the
necessary ptesync not being issued after vmalloc.

This causes random kernel faults in module load, bpf load, anywhere
that vmalloc mappings are used.

After correcting the code, this survives a guest kernel booting
hundreds of times where previously there would be a crash every few
boots (I haven't noticed the crash on host, perhaps due to different
TLB and page table walking behaviour in hardware).

A memory clobber is also added to the flush, just to be sure it won't
be reordered with the pte set or the subsequent mapping access.

Fixes: c1a5e51b58 ("powerpc/64s/radix: avoid ptesync after set_pte and ptep_set_access_flags")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cacheflush.h