linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] small ptrace fixes
@ 2019-04-04 16:16 Sven Schnelle
  2019-04-04 16:16 ` [PATCH 1/2] parisc: regs_return_value() should return gpr28 Sven Schnelle
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sven Schnelle @ 2019-04-04 16:16 UTC (permalink / raw)
  To: linux-parisc; +Cc: Sven Schnelle

Hi,

while working on kprobes i found two small issues in ptrace.h.

Sven Schnelle (2):
  parisc: regs_return_value() should return gpr28
  parisc: also set iaoq_b in instruction_pointer_set()

 arch/parisc/include/asm/ptrace.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] parisc: regs_return_value() should return gpr28
  2019-04-04 16:16 [PATCH 0/2] small ptrace fixes Sven Schnelle
@ 2019-04-04 16:16 ` Sven Schnelle
  2019-04-04 16:16 ` [PATCH 2/2] parisc: also set iaoq_b in instruction_pointer_set() Sven Schnelle
  2019-04-04 17:54 ` [PATCH 0/2] small ptrace fixes Helge Deller
  2 siblings, 0 replies; 4+ messages in thread
From: Sven Schnelle @ 2019-04-04 16:16 UTC (permalink / raw)
  To: linux-parisc; +Cc: Sven Schnelle

While working on kretprobes for PA-RISC i was wondering while the
kprobes sanity test always fails on kretprobes. This is caused by
returning gpr20 instead of gpr28.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/parisc/include/asm/ptrace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/include/asm/ptrace.h b/arch/parisc/include/asm/ptrace.h
index 2a27b275ab09..4a87b3d600c6 100644
--- a/arch/parisc/include/asm/ptrace.h
+++ b/arch/parisc/include/asm/ptrace.h
@@ -22,7 +22,7 @@ unsigned long profile_pc(struct pt_regs *);
 
 static inline unsigned long regs_return_value(struct pt_regs *regs)
 {
-	return regs->gr[20];
+	return regs->gr[28];
 }
 
 static inline void instruction_pointer_set(struct pt_regs *regs,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] parisc: also set iaoq_b in instruction_pointer_set()
  2019-04-04 16:16 [PATCH 0/2] small ptrace fixes Sven Schnelle
  2019-04-04 16:16 ` [PATCH 1/2] parisc: regs_return_value() should return gpr28 Sven Schnelle
@ 2019-04-04 16:16 ` Sven Schnelle
  2019-04-04 17:54 ` [PATCH 0/2] small ptrace fixes Helge Deller
  2 siblings, 0 replies; 4+ messages in thread
From: Sven Schnelle @ 2019-04-04 16:16 UTC (permalink / raw)
  To: linux-parisc; +Cc: Sven Schnelle

When setting the instruction pointer on PA-RISC we also need
to set the back of the instruction queue to the new offset, otherwise
we will execute on instruction from the new location, and jumping
back to the old location stored in iaoq_b.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/parisc/include/asm/ptrace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/include/asm/ptrace.h b/arch/parisc/include/asm/ptrace.h
index 4a87b3d600c6..9ff033d261ab 100644
--- a/arch/parisc/include/asm/ptrace.h
+++ b/arch/parisc/include/asm/ptrace.h
@@ -28,7 +28,8 @@ static inline unsigned long regs_return_value(struct pt_regs *regs)
 static inline void instruction_pointer_set(struct pt_regs *regs,
 						unsigned long val)
 {
-        regs->iaoq[0] = val;
+	regs->iaoq[0] = val;
+	regs->iaoq[1] = val + 4;
 }
 
 /* Query offset/name of register from its name/offset */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] small ptrace fixes
  2019-04-04 16:16 [PATCH 0/2] small ptrace fixes Sven Schnelle
  2019-04-04 16:16 ` [PATCH 1/2] parisc: regs_return_value() should return gpr28 Sven Schnelle
  2019-04-04 16:16 ` [PATCH 2/2] parisc: also set iaoq_b in instruction_pointer_set() Sven Schnelle
@ 2019-04-04 17:54 ` Helge Deller
  2 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2019-04-04 17:54 UTC (permalink / raw)
  To: Sven Schnelle, linux-parisc

On 04.04.19 18:16, Sven Schnelle wrote:
> while working on kprobes i found two small issues in ptrace.h.
>
> Sven Schnelle (2):
>   parisc: regs_return_value() should return gpr28
>   parisc: also set iaoq_b in instruction_pointer_set()
>
>  arch/parisc/include/asm/ptrace.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Thanks, applied to my for-next tree.

Helge

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-04 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 16:16 [PATCH 0/2] small ptrace fixes Sven Schnelle
2019-04-04 16:16 ` [PATCH 1/2] parisc: regs_return_value() should return gpr28 Sven Schnelle
2019-04-04 16:16 ` [PATCH 2/2] parisc: also set iaoq_b in instruction_pointer_set() Sven Schnelle
2019-04-04 17:54 ` [PATCH 0/2] small ptrace fixes Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).