linux-csky.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: guoren@kernel.org
To: guoren@kernel.org, arnd@arndb.de
Cc: linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org,
	linux-arch@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>
Subject: [PATCH 05/13] csky: Fixup kprobes handler couldn't change pc
Date: Sat,  1 Aug 2020 01:14:05 +0000	[thread overview]
Message-ID: <1596244453-98575-6-git-send-email-guoren@kernel.org> (raw)
In-Reply-To: <1596244453-98575-1-git-send-email-guoren@kernel.org>

From: Guo Ren <guoren@linux.alibaba.com>

The "Changing Execution Path" section in the Documentation/kprobes.txt
said:

Since kprobes can probe into a running kernel code, it can change the
register set, including instruction pointer.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/csky/abiv2/mcount.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/csky/abiv2/mcount.S b/arch/csky/abiv2/mcount.S
index 911512b..d745e10 100644
--- a/arch/csky/abiv2/mcount.S
+++ b/arch/csky/abiv2/mcount.S
@@ -55,7 +55,9 @@
 
 .macro mcount_exit_regs
 	RESTORE_REGS_FTRACE
-	ldw	t1, (sp, 0)
+	subi	sp, 152
+	ldw	t1, (sp, 4)
+	addi	sp, 152
 	ldw	r8, (sp, 4)
 	ldw	lr, (sp, 8)
 	addi	sp, 12
-- 
2.7.4


  parent reply	other threads:[~2020-08-01  1:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01  1:14 [PATCH 00/13] Update csky subsystem for linux-5.9-rc1 guoren
2020-08-01  1:14 ` [PATCH 01/13] csky: remove unusued thread_saved_pc and *_segments functions/macros guoren
2020-08-01  1:14 ` [PATCH 02/13] csky: Add SECCOMP_FILTER supported guoren
2020-08-01  1:14 ` [PATCH 03/13] csky: Add cpu feature register hint for smp guoren
2020-08-01  1:14 ` [PATCH 04/13] csky: Fixup duplicated restore sp in RESTORE_REGS_FTRACE guoren
2020-08-01  1:14 ` guoren [this message]
2020-08-01  1:14 ` [PATCH 06/13] csky: Add support for function error injection guoren
2020-08-01  1:14 ` [PATCH 07/13] csky: Optimize the trap processing flow guoren
2020-08-01  1:14 ` [PATCH 08/13] csky: Use top-down mmap layout guoren
2020-08-01  1:14 ` [PATCH 09/13] csky: Set CONFIG_NR_CPU 4 as default guoren
2020-08-01  1:14 ` [PATCH 10/13] csky: Fixup warning by EXPORT_SYMBOL(kmap) guoren
2020-08-01  1:14 ` [PATCH 11/13] csky: Add irq_work support guoren
2020-08-01  1:14 ` [PATCH 12/13] csky: Add arch_show_interrupts for IPI interrupts guoren
2020-08-01  1:14 ` [PATCH 13/13] csky: Add context tracking support guoren

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=1596244453-98575-6-git-send-email-guoren@kernel.org \
    --to=guoren@kernel.org \
    --cc=arnd@arndb.de \
    --cc=guoren@linux.alibaba.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-csky@vger.kernel.org \
    --cc=linux-kernel@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).