From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Guo Ren <guoren@kernel.org>
Cc: linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org,
loongson-kernel@lists.loongnix.cn,
Oleg Nesterov <oleg@redhat.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [PATCH] csky: uprobes: Restore thread.trap_no
Date: Mon, 24 Apr 2023 19:47:13 +0800 [thread overview]
Message-ID: <cdacf9d8-cf59-bf4e-5379-0b5bfc03a4e2@loongson.cn> (raw)
In-Reply-To: <1682213987-3708-1-git-send-email-yangtiezhu@loongson.cn>
Cc:
Oleg Nesterov <oleg@redhat.com>
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
On 04/23/2023 09:39 AM, Tiezhu Yang wrote:
> thread.trap_no is saved in arch_uprobe_pre_xol(), it should be restored
> in arch_uprobe_{post,abort}_xol() accordingly, otherwise the save operation
> is meaningless, this change is similar with x86 and powerpc.
>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> arch/csky/kernel/probes/uprobes.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/csky/kernel/probes/uprobes.c b/arch/csky/kernel/probes/uprobes.c
> index 2d31a12..6277f2b 100644
> --- a/arch/csky/kernel/probes/uprobes.c
> +++ b/arch/csky/kernel/probes/uprobes.c
> @@ -64,6 +64,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> struct uprobe_task *utask = current->utask;
>
> WARN_ON_ONCE(current->thread.trap_no != UPROBE_TRAP_NR);
> + current->thread.trap_no = utask->autask.saved_trap_no;
>
> instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size);
>
> @@ -101,6 +102,7 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> {
> struct uprobe_task *utask = current->utask;
>
> + current->thread.trap_no = utask->autask.saved_trap_no;
> /*
> * Task has received a fatal signal, so reset back to probed
> * address.
>
Hi Oleg and Srikar,
Could you please review this patch, thank you.
Thanks,
Tiezhu
next prev parent reply other threads:[~2023-04-24 11:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 1:39 [PATCH] csky: uprobes: Restore thread.trap_no Tiezhu Yang
2023-04-24 11:47 ` Tiezhu Yang [this message]
2023-04-24 15:28 ` Oleg Nesterov
2023-06-15 15:33 ` Tiezhu Yang
2023-06-15 16:56 ` Oleg Nesterov
2023-06-16 1:19 ` Tiezhu Yang
2023-06-18 7:07 ` Guo Ren
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=cdacf9d8-cf59-bf4e-5379-0b5bfc03a4e2@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=guoren@kernel.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=oleg@redhat.com \
--cc=srikar@linux.vnet.ibm.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).