* [PATCH] csky: uprobes: Restore thread.trap_no
@ 2023-04-23 1:39 Tiezhu Yang
2023-04-24 11:47 ` Tiezhu Yang
0 siblings, 1 reply; 7+ messages in thread
From: Tiezhu Yang @ 2023-04-23 1:39 UTC (permalink / raw)
To: Guo Ren; +Cc: linux-csky, linux-kernel, loongson-kernel
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.
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-04-23 1:39 [PATCH] csky: uprobes: Restore thread.trap_no Tiezhu Yang
@ 2023-04-24 11:47 ` Tiezhu Yang
2023-04-24 15:28 ` Oleg Nesterov
0 siblings, 1 reply; 7+ messages in thread
From: Tiezhu Yang @ 2023-04-24 11:47 UTC (permalink / raw)
To: Guo Ren
Cc: linux-csky, linux-kernel, loongson-kernel, Oleg Nesterov,
Srikar Dronamraju
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-04-24 11:47 ` Tiezhu Yang
@ 2023-04-24 15:28 ` Oleg Nesterov
2023-06-15 15:33 ` Tiezhu Yang
0 siblings, 1 reply; 7+ messages in thread
From: Oleg Nesterov @ 2023-04-24 15:28 UTC (permalink / raw)
To: Tiezhu Yang
Cc: Guo Ren, linux-csky, linux-kernel, loongson-kernel,
Srikar Dronamraju
On 04/24, Tiezhu Yang wrote:
>
> >--- 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.
Acked-by: Oleg Nesterov <oleg@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-04-24 15:28 ` Oleg Nesterov
@ 2023-06-15 15:33 ` Tiezhu Yang
2023-06-15 16:56 ` Oleg Nesterov
0 siblings, 1 reply; 7+ messages in thread
From: Tiezhu Yang @ 2023-06-15 15:33 UTC (permalink / raw)
To: oleg; +Cc: guoren, linux-csky, linux-kernel, loongson-kernel, srikar,
yangtiezhu
ping, what is the status of this patch which has been received Acked-by:
https://lore.kernel.org/linux-csky/1682213987-3708-1-git-send-email-yangtiezhu@loongson.cn/
Thanks,
Tiezhu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-06-15 15:33 ` Tiezhu Yang
@ 2023-06-15 16:56 ` Oleg Nesterov
2023-06-16 1:19 ` Tiezhu Yang
0 siblings, 1 reply; 7+ messages in thread
From: Oleg Nesterov @ 2023-06-15 16:56 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: guoren, linux-csky, linux-kernel, loongson-kernel, srikar
Hi Tiezhu,
I think you should ask arch/csky maintainers ;)
On 06/15, Tiezhu Yang wrote:
>
> ping, what is the status of this patch which has been received Acked-by:
>
> https://lore.kernel.org/linux-csky/1682213987-3708-1-git-send-email-yangtiezhu@loongson.cn/
>
> Thanks,
> Tiezhu
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-06-15 16:56 ` Oleg Nesterov
@ 2023-06-16 1:19 ` Tiezhu Yang
2023-06-18 7:07 ` Guo Ren
0 siblings, 1 reply; 7+ messages in thread
From: Tiezhu Yang @ 2023-06-16 1:19 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: guoren, linux-csky, linux-kernel, loongson-kernel, srikar
On 06/16/2023 12:56 AM, Oleg Nesterov wrote:
> Hi Tiezhu,
>
> I think you should ask arch/csky maintainers ;)
Yes, thank you, sorry to trouble you.
>
> On 06/15, Tiezhu Yang wrote:
>>
>> ping, what is the status of this patch which has been received Acked-by:
>>
>> https://lore.kernel.org/linux-csky/1682213987-3708-1-git-send-email-yangtiezhu@loongson.cn/
Maybe Guo Ren (the maintainer of C-SKY ARCHITECTURE) could
take a look at it, thank you.
Thanks,
Tiezhu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] csky: uprobes: Restore thread.trap_no
2023-06-16 1:19 ` Tiezhu Yang
@ 2023-06-18 7:07 ` Guo Ren
0 siblings, 0 replies; 7+ messages in thread
From: Guo Ren @ 2023-06-18 7:07 UTC (permalink / raw)
To: Tiezhu Yang
Cc: Oleg Nesterov, linux-csky, linux-kernel, loongson-kernel, srikar
On Fri, Jun 16, 2023 at 9:20 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
>
>
> On 06/16/2023 12:56 AM, Oleg Nesterov wrote:
> > Hi Tiezhu,
> >
> > I think you should ask arch/csky maintainers ;)
>
> Yes, thank you, sorry to trouble you.
>
> >
> > On 06/15, Tiezhu Yang wrote:
> >>
> >> ping, what is the status of this patch which has been received Acked-by:
> >>
> >> https://lore.kernel.org/linux-csky/1682213987-3708-1-git-send-email-yangtiezhu@loongson.cn/
>
> Maybe Guo Ren (the maintainer of C-SKY ARCHITECTURE) could
> take a look at it, thank you.
Sorry, I missed that. I would test it and put it into for-next.
>
> Thanks,
> Tiezhu
>
--
Best Regards
Guo Ren
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-06-18 7:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-23 1:39 [PATCH] csky: uprobes: Restore thread.trap_no Tiezhu Yang
2023-04-24 11:47 ` Tiezhu Yang
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
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).