# 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 120 ARCH=powerpc O=/kisskb/build/powerpc-fixes_40x_obs600_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- 40x/obs600_defconfig # make -s -j 120 ARCH=powerpc O=/kisskb/build/powerpc-fixes_40x_obs600_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/arch/powerpc/kernel/head_40x.S: Assembler messages: /kisskb/src/arch/powerpc/kernel/head_40x.S:808: Warning: invalid register expression INFO: Uncompressed kernel (size 0x4c7bc0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x500000) Image Name: Linux-5.2.0-rc2-g500871125920 Created: Fri Jun 21 00:29:52 2019 Image Type: PowerPC Linux Multi-File Image (gzip compressed) Data Size: 2460982 Bytes = 2403.30 KiB = 2.35 MiB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 2454093 Bytes = 2396.58 KiB = 2.34 MiB Image 1: 3 Bytes = 0.00 KiB = 0.00 MiB Image 2: 6866 Bytes = 6.71 KiB = 0.01 MiB Completed OK # rm -rf /kisskb/build/powerpc-fixes_40x_obs600_defconfig_powerpc-gcc5 # Build took: 0:00:22.088358