# 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-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 d9c57d3ed52a92536f5fa59dc5ccdd58b4875076 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+NO_MEMORY_HOTREMOVE_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- pseries_defconfig # Added to kconfig CONFIG_MEMORY_HOTPLUG=y # Added to kconfig CONFIG_MEMORY_HOTREMOVE=n # < make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+NO_MEMORY_HOTREMOVE_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+NO_MEMORY_HOTREMOVE_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig # make -s -j 80 ARCH=powerpc O=/kisskb/build/powerpc-fixes_pseries_defconfig+NO_MEMORY_HOTREMOVE_powerpc-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/net/sched/sch_frag.c: In function 'sch_fragment': /kisskb/src/net/sched/sch_frag.c:93:10: warning: missing braces around initializer [-Wmissing-braces] struct rtable sch_frag_rt = { 0 }; ^ /kisskb/src/net/sched/sch_frag.c:93:10: warning: (near initialization for 'sch_frag_rt.dst') [-Wmissing-braces] /kisskb/src/drivers/net/ethernet/chelsio/cxgb4/sge.c: In function 'cxgb4_write_partial_sgl': /kisskb/src/drivers/net/ethernet/chelsio/cxgb4/sge.c:910:9: warning: missing braces around initializer [-Wmissing-braces] struct ulptx_sge_pair buf[MAX_SKB_FRAGS / 2 + 1] = {0}, *to; ^ /kisskb/src/drivers/net/ethernet/chelsio/cxgb4/sge.c:910:9: warning: (near initialization for 'buf[0]') [-Wmissing-braces] /kisskb/src/fs/btrfs/tree-checker.c: In function 'check_root_item': /kisskb/src/fs/btrfs/tree-checker.c:1071:9: warning: missing braces around initializer [-Wmissing-braces] struct btrfs_root_item ri = { 0 }; ^ /kisskb/src/fs/btrfs/tree-checker.c:1071:9: warning: (near initialization for 'ri.inode') [-Wmissing-braces] Completed OK # rm -rf /kisskb/build/powerpc-fixes_pseries_defconfig+NO_MEMORY_HOTREMOVE_powerpc-gcc4.9 # Build took: 0:03:32.021299