Skip to contentSkip to conversation

powerpc: Fix sstep compile on powerpcspe

PATCH Applied Lennart Sorensen 2 participants 3 messages May 5, 2016 – May 10, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix sstep compile on powerpcspe

powerpc: Fix sstep compile on powerpcspe

Commit be96f63375a14ee8e690856ac77e579c75bd0bae introduced ldarx and stdcx into the instructions in sstep.c, which are not accepted by the assembler on powerpcspe, but does seem to be accepted by the normal powerpc assembler even in 32 bit mode.

Wrap these two instructions in a __powerpc64__ check like it is everywhere else in the file.

Fixes be96f63375a1 ("powerpc: Split out instruction analysis part of emulate_step()")
---
 arch/powerpc/lib/sstep.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/powerpc/lib/sstep.c +4 -0
index dc885b3..6d34310 100644
@@ -1818,9 +1818,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		case 4:
 			__get_user_asmx(val, op.ea, err, "lwarx");
 			break;
+#ifdef __powerpc64__
 		case 8:
 			__get_user_asmx(val, op.ea, err, "ldarx");
 			break;
+#endif
 		default:
 			return 0;
 		}
@@ -1841,9 +1843,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		case 4:
 			__put_user_asmx(op.val, op.ea, err, "stwcx.", cr);
 			break;
+#ifdef __powerpc64__
 		case 8:
 			__put_user_asmx(op.val, op.ea, err, "stdcx.", cr);
 			break;
+#endif
 		default:
 			return 0;
 		}
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 46 lines · Lennart Sorensen

powerpc: Fix sstep compile on powerpcspe

Commit be96f63375a14ee8e690856ac77e579c75bd0bae introduced ldarx and stdcx into the instructions in sstep.c, which are not accepted by the assembler on powerpcspe, but does seem to be accepted by the normal powerpc assembler even in 32 bit mode.

Wrap these two instructions in a __powerpc64__ check like it is everywhere else in the file.

Fixes be96f63375a1 ("powerpc: Split out instruction analysis part of emulate_step()")
---
 arch/powerpc/lib/sstep.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/powerpc/lib/sstep.c +4 -0
index dc885b3..6d34310 100644
@@ -1818,9 +1818,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		case 4:
 			__get_user_asmx(val, op.ea, err, "lwarx");
 			break;
+#ifdef __powerpc64__
 		case 8:
 			__get_user_asmx(val, op.ea, err, "ldarx");
 			break;
+#endif
 		default:
 			return 0;
 		}
@@ -1841,9 +1843,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
 		case 4:
 			__put_user_asmx(op.val, op.ea, err, "stwcx.", cr);
 			break;
+#ifdef __powerpc64__
 		case 8:
 			__put_user_asmx(op.val, op.ea, err, "stdcx.", cr);
 			break;
+#endif
 		default:
 			return 0;
 		}
Signature · 1 line
1.7.10.4

Perhaps this should be considered for -stable as well since it is fixing a regression for powerpcspe.

Signature · 1 line
Len Sorensen
reviewer Applied
#2 lore raw
In reply to Lennart Sorensen
Quoted 7 lines · Lennart Sorensen

powerpc: Fix sstep compile on powerpcspe

Commit be96f63375a14ee8e690856ac77e579c75bd0bae introduced ldarx and stdcx into the instructions in sstep.c, which are not accepted by the assembler on powerpcspe, but does seem to be accepted by the normal powerpc assembler even in 32 bit mode.

Quoted 5 lines

Wrap these two instructions in a __powerpc64__ check like it is everywhere else in the file.

Fixes be96f63375a1 ("powerpc: Split out instruction analysis part of emulate_step()")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/03be7e53dee606c189a66a7389

cheers