powerpc/sstep: Check instruction validity against ISA version before emulation
authorAnanth N Mavinakayanahalli <ananth@linux.ibm.com>
Mon, 25 Jan 2021 13:06:22 +0000 (18:36 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 11:34:15 +0000 (12:34 +0100)
commit20d323c8cf5730eb1693ef3fcf0919b35a20e6ad
tree86a056bf4c5205c6108e525b4f2107b147e8d69f
parent04b049ac9cb4eb425998f690fbd416757a7c9b15
powerpc/sstep: Check instruction validity against ISA version before emulation

commit 8813ff49607eab3caaf40fe8929b0ce7dc68e85f upstream.

We currently unconditionally try to emulate newer instructions on older
Power versions that could cause issues. Gate it.

Fixes: 350779a29f11 ("powerpc: Handle most loads and stores in instruction emulation code")
Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/161157995977.64773.13794501093457185080.stgit@thinktux.local
[Dropped a few missing hunks for the backport to v5.10]
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/lib/sstep.c