This is a note to let you know that I've just added the patch titled powerpc/sstep: Fix incorrect return from analyze_instr() to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-sstep-fix-incorrect-return-from-analyze_instr.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 718aae916fa6619c57c348beaedd675835cf1aa1 Mon Sep 17 00:00:00 2001 From: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxxxxx> Date: Mon, 25 Jan 2021 18:36:43 +0530 Subject: powerpc/sstep: Fix incorrect return from analyze_instr() From: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxxxxx> commit 718aae916fa6619c57c348beaedd675835cf1aa1 upstream. We currently just percolate the return value from analyze_instr() to the caller of emulate_step(), especially if it is a -1. For one particular case (opcode = 4) for instructions that aren't currently emulated, we are returning 'should not be single-stepped' while we should have returned 0 which says 'did not emulate, may have to single-step'. Fixes: 930d6288a26787 ("powerpc: sstep: Add support for maddhd, maddhdu, maddld instructions") Signed-off-by: Ananth N Mavinakayanahalli <ananth@xxxxxxxxxxxxx> Suggested-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Tested-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx> Reviewed-by: Sandipan Das <sandipan@xxxxxxxxxxxxx> Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/161157999039.64773.14950289716779364766.stgit@thinktux.local Signed-off-by: Naveen N. Rao <naveen.n.rao@xxxxxxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/lib/sstep.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1382,6 +1382,11 @@ int analyse_instr(struct instruction_op #ifdef __powerpc64__ case 4: + /* + * There are very many instructions with this primary opcode + * introduced in the ISA as early as v2.03. However, the ones + * we currently emulate were all introduced with ISA 3.0 + */ if (!cpu_has_feature(CPU_FTR_ARCH_300)) goto unknown_opcode; @@ -1409,7 +1414,7 @@ int analyse_instr(struct instruction_op * There are other instructions from ISA 3.0 with the same * primary opcode which do not have emulation support yet. */ - return -1; + goto unknown_opcode; #endif case 7: /* mulli */ Patches currently in stable-queue which might be from ananth@xxxxxxxxxxxxx are queue-5.10/powerpc-sstep-fix-incorrect-return-from-analyze_instr.patch queue-5.10/powerpc-sstep-check-instruction-validity-against-isa-version-before-emulation.patch