diff options
| author | Balamuruhan S <[email protected]> | 2020-10-11 10:39:04 +0530 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2020-12-11 00:09:09 +1100 |
| commit | ef6879f8c8053cc3b493f400a06d452d7fb13650 (patch) | |
| tree | c0fed89657017893685c03c83fe84c1c6aaba355 | |
| parent | 02b02ee1b05ef225525835b2d45faf31b3420bdd (diff) | |
powerpc/sstep: Emulate prefixed instructions only when CPU_FTR_ARCH_31 is set
Unconditional emulation of prefixed instructions will allow
emulation of them on Power10 predecessors which might cause
issues. Restrict that.
Fixes: 3920742b92f5 ("powerpc sstep: Add support for prefixed fixed-point arithmetic")
Fixes: 50b80a12e4cc ("powerpc sstep: Add support for prefixed load/stores")
Signed-off-by: Balamuruhan S <[email protected]>
Signed-off-by: Ravi Bangoria <[email protected]>
Reviewed-by: Sandipan Das <[email protected]>
Reviewed-by: Daniel Axtens <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
| -rw-r--r-- | arch/powerpc/lib/sstep.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index 855457ed09b5..bf2cd3d42125 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c @@ -1346,6 +1346,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, switch (opcode) { #ifdef __powerpc64__ case 1: + if (!cpu_has_feature(CPU_FTR_ARCH_31)) + return -1; + prefix_r = GET_PREFIX_R(word); ra = GET_PREFIX_RA(suffix); rd = (suffix >> 21) & 0x1f; @@ -2733,6 +2736,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, } break; case 1: /* Prefixed instructions */ + if (!cpu_has_feature(CPU_FTR_ARCH_31)) + return -1; + prefix_r = GET_PREFIX_R(word); ra = GET_PREFIX_RA(suffix); op->update_reg = ra; |