# git rev-parse -q --verify d9c57d3ed52a92536f5fa59dc5ccdd58b4875076^{commit} # git fetch -q -n -f git://gitlab.ozlabs.ibm.com/linuxppc/linux.git fixes-test # git rev-parse -q --verify d9c57d3ed52a92536f5fa59dc5ccdd58b4875076^{commit} d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # git checkout -q -f -B kisskb d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # git clean -qxdf # < git log -1 # commit d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # Author: Nicholas Piggin # Date: Thu Jul 8 21:26:22 2021 +1000 # # KVM: PPC: Book3S HV Nested: Sanitise H_ENTER_NESTED TM state # # The H_ENTER_NESTED hypercall is handled by the L0, and it is a request # by the L1 to switch the context of the vCPU over to that of its L2 # guest, and return with an interrupt indication. The L1 is responsible # for switching some registers to guest context, and the L0 switches # others (including all the hypervisor privileged state). # # If the L2 MSR has TM active, then the L1 is responsible for # recheckpointing the L2 TM state. Then the L1 exits to L0 via the # H_ENTER_NESTED hcall, and the L0 saves the TM state as part of the exit, # and then it recheckpoints the TM state as part of the nested entry and # finally HRFIDs into the L2 with TM active MSR. Not efficient, but about # the simplest approach for something that's horrendously complicated. # # Problems arise if the L1 exits to the L0 with a TM state which does not # match the L2 TM state being requested. For example if the L1 is # transactional but the L2 MSR is non-transactional, or vice versa. The # L0's HRFID can take a TM Bad Thing interrupt and crash. # # Fix this by disallowing H_ENTER_NESTED in TM[T] state entirely, and then # ensuring that if the L1 is suspended then the L2 must have TM active, # and if the L1 is not suspended then the L2 must not have TM active. # # Fixes: 360cae313702 ("KVM: PPC: Book3S HV: Nested guest entry via hypercall") # Cc: stable@vger.kernel.org # v4.20+ # Reported-by: Alexey Kardashevskiy # Acked-by: Michael Neuling # Signed-off-by: Nicholas Piggin # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-gcc --version # < /opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux-ld --version # < git log --format=%s --max-count=1 d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # < make -s -j 24 ARCH=arm64 O=/kisskb/build/powerpc-fixes_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- defconfig # < make -s -j 24 ARCH=arm64 O=/kisskb/build/powerpc-fixes_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- help # make -s -j 24 ARCH=arm64 O=/kisskb/build/powerpc-fixes_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- olddefconfig # make -s -j 24 ARCH=arm64 O=/kisskb/build/powerpc-fixes_arm64-defconfig_arm64-gcc5.4 CROSS_COMPILE=/opt/cross/kisskb/br-aarch64-glibc-2016.08-613-ge98b4dd/bin/aarch64-linux- /kisskb/src/arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum /kisskb/src/arch/arm64/Makefile:33: LSE atomics not supported by binutils Completed OK # rm -rf /kisskb/build/powerpc-fixes_arm64-defconfig_arm64-gcc5.4 # Build took: 0:07:17.951237