# git rev-parse -q --verify 50087112592016a3fc10b394a55f1f1a1bde6908^{commit} 50087112592016a3fc10b394a55f1f1a1bde6908 already have revision, skipping fetch # git checkout -q -f -B kisskb 50087112592016a3fc10b394a55f1f1a1bde6908 # git clean -qxdf # < git log -1 # commit 50087112592016a3fc10b394a55f1f1a1bde6908 # Author: Suraj Jitindar Singh # Date: Thu Jun 20 11:46:49 2019 +1000 # # KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries # # When a guest vcpu moves from one physical thread to another it is # necessary for the host to perform a tlb flush on the previous core if # another vcpu from the same guest is going to run there. This is because the # guest may use the local form of the tlb invalidation instruction meaning # stale tlb entries would persist where it previously ran. This is handled # on guest entry in kvmppc_check_need_tlb_flush() which calls # flush_guest_tlb() to perform the tlb flush. # # Previously the generic radix__local_flush_tlb_lpid_guest() function was # used, however the functionality was reimplemented in flush_guest_tlb() # to avoid the trace_tlbie() call as the flushing may be done in real # mode. The reimplementation in flush_guest_tlb() was missing an erat # invalidation after flushing the tlb. # # This lead to observable memory corruption in the guest due to the # caching of stale translations. Fix this by adding the erat invalidation. # # Fixes: 70ea13f6e609 ("KVM: PPC: Book3S HV: Flush TLB on secondary radix threads") # Signed-off-by: Suraj Jitindar Singh # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 50087112592016a3fc10b394a55f1f1a1bde6908 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mgcoge_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mgcoge_defconfig # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mgcoge_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/kernel/futex.c: In function 'do_futex': /kisskb/src/kernel/futex.c:1658:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] return oldval == cmparg; ^ /kisskb/src/kernel/futex.c:1633:6: note: 'oldval' was declared here int oldval, ret; ^ /kisskb/src/arch/powerpc/kernel/head_32.S: Assembler messages: /kisskb/src/arch/powerpc/kernel/head_32.S:932: Warning: invalid register expression Completed OK # rm -rf /kisskb/build/powerpc-fixes_mgcoge_defconfig_powerpc-gcc5 # Build took: 0:00:51.986657