All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <geomatsi@gmail.com>
To: linux-snps-arc@lists.infradead.org
Cc: Vineet Gupta <vgupta@kernel.org>,
	Vladimir Isaev <isaev@synopsys.com>,
	Sergey Matyukevich <geomatsi@gmail.com>,
	Sergey Matyukevich <sergey.matyukevich@synopsys.com>
Subject: [PATCH v2 2/4] ARC: entry: fix syscall_trace_exit argument
Date: Thu, 14 Apr 2022 11:17:22 +0300	[thread overview]
Message-ID: <20220414081724.3177956-3-geomatsi@gmail.com> (raw)
In-Reply-To: <20220414081724.3177956-1-geomatsi@gmail.com>

From: Sergey Matyukevich <sergey.matyukevich@synopsys.com>

Function syscall_trace_exit expects pointer to pt_regs. However
r0 is also used to keep syscall return value. Restore pointer
to pt_regs before calling syscall_trace_exit.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich@synopsys.com>
---
 arch/arc/kernel/entry.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index dd77a0c8f740..66ba549b520f 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -196,6 +196,7 @@ tracesys_exit:
 	st  r0, [sp, PT_r0]     ; sys call return value in pt_regs
 
 	;POST Sys Call Ptrace Hook
+	mov r0, sp		; pt_regs needed
 	bl  @syscall_trace_exit
 	b   ret_from_exception ; NOT ret_from_system_call at is saves r0 which
 	; we'd done before calling post hook above
-- 
2.35.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  parent reply	other threads:[~2022-04-14  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  8:17 [PATCH v2 0/4] ARC: add missing bits for better BPF support Sergey Matyukevich
2022-04-14  8:17 ` [PATCH v2 1/4] ARC: enable HAVE_REGS_AND_STACK_ACCESS_API feature Sergey Matyukevich
2022-04-14  8:17 ` Sergey Matyukevich [this message]
2022-04-18 19:14   ` [PATCH v2 2/4] ARC: entry: fix syscall_trace_exit argument Vineet Gupta
2022-04-14  8:17 ` [PATCH v2 3/4] ARC: implement syscall tracepoints Sergey Matyukevich
2022-04-14  8:17 ` [PATCH v2 4/4] ARC: disasm: handle ARCv2 case in kprobe get/set functions Sergey Matyukevich
2022-04-18 19:10 ` [PATCH v2 0/4] ARC: add missing bits for better BPF support Vineet Gupta

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=20220414081724.3177956-3-geomatsi@gmail.com \
    --to=geomatsi@gmail.com \
    --cc=isaev@synopsys.com \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=sergey.matyukevich@synopsys.com \
    --cc=vgupta@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.