# git rev-parse -q --verify d9c57d3ed52a92536f5fa59dc5ccdd58b4875076^{commit} d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 already have revision, skipping fetch # 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/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # < make -s -j 32 ARCH=x86 O=/kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # < make -s -j 32 ARCH=x86 O=/kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux- help # make -s -j 32 ARCH=x86 O=/kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux- olddefconfig # make -s -j 32 ARCH=x86 O=/kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux- /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-objdump: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-objdump: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-objdump: mm/kfence/kfence_test.o: File format not recognized /kisskb/src/kernel/trace/trace_osnoise.c: In function 'start_kthread': /kisskb/src/kernel/trace/trace_osnoise.c:1461:8: warning: 'main' is usually a function [-Wmain] void *main = osnoise_main; ^~~~ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_val_width': /kisskb/src/lib/test_scanf.c:530:1: warning: the frame size of 2472 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list_field_width_typemax': /kisskb/src/lib/test_scanf.c:488:1: warning: the frame size of 2952 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/lib/test_scanf.c: In function 'numbers_list': /kisskb/src/lib/test_scanf.c:437:1: warning: the frame size of 2472 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info /opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux-ld: mm/kfence/kfence_test.o: unable to initialize decompress status for section .debug_info mm/kfence/kfence_test.o: file not recognized: File format not recognized make[3]: *** [/kisskb/src/scripts/Makefile.modfinal:76: mm/kfence/kfence_test.ko] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.modpost:156: __modpost] Error 2 make[1]: *** [/kisskb/src/Makefile:1756: modules] Error 2 make: *** [Makefile:220: __sub-make] Error 2 Command 'make -s -j 32 ARCH=x86 O=/kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-8.1.0-nolibc/x86_64-linux/bin/x86_64-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-fixes_x86-allmodconfig_x86_64-gcc8 # Build took: 0:16:55.909266