# 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 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc8272_ads_defconfig_powerpc-gcc5 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-5.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc8272_ads_defconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc8272_ads_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_32.S: Assembler messages: /kisskb/src/arch/powerpc/kernel/head_32.S:932: Warning: invalid register expression /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; ^ INFO: Uncompressed kernel (size 0x5733ac) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) INFO: Uncompressed kernel (size 0x562d68) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Image Name: Linux-5.2.0-rc2-g500871125920 Created: Fri Jun 21 00:27:40 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2800697 Bytes = 2735.06 KiB = 2.67 MiB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-5.2.0-rc2-g500871125920 Created: Fri Jun 21 00:27:41 2019 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 2831218 Bytes = 2764.86 KiB = 2.70 MiB Load Address: 00600000 Entry Point: 00600894 Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc8272_ads_defconfig_powerpc-gcc5 # Build took: 0:00:47.651014