linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@stackframe.org>
To: linux-parisc@vger.kernel.org
Cc: Sven Schnelle <svens@stackframe.org>
Subject: [PATCH 2/2] parisc: also set iaoq_b in instruction_pointer_set()
Date: Thu,  4 Apr 2019 18:16:04 +0200	[thread overview]
Message-ID: <20190404161604.6165-3-svens@stackframe.org> (raw)
In-Reply-To: <20190404161604.6165-1-svens@stackframe.org>

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


  parent reply	other threads:[~2019-04-04 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-04-04 17:54 ` [PATCH 0/2] small ptrace fixes Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404161604.6165-3-svens@stackframe.org \
    --to=svens@stackframe.org \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).