[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f60e6e0f-a520-2e8d-0b81-6b15498cb300@loongson.cn>
Date: Mon, 24 Apr 2023 19:49:21 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>
Cc: Guo Ren <guoren@...nel.org>, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org, loongson-kernel@...ts.loongnix.cn,
Oleg Nesterov <oleg@...hat.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Subject: Re: [PATCH] riscv: uprobes: Restore thread.bad_cause
Cc:
Oleg Nesterov <oleg@...hat.com>
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
On 04/23/2023 09:42 AM, Tiezhu Yang wrote:
> thread.bad_cause 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@...ngson.cn>
> ---
> arch/riscv/kernel/probes/uprobes.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/kernel/probes/uprobes.c b/arch/riscv/kernel/probes/uprobes.c
> index c976a21..194f166 100644
> --- a/arch/riscv/kernel/probes/uprobes.c
> +++ b/arch/riscv/kernel/probes/uprobes.c
> @@ -67,6 +67,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.bad_cause != UPROBE_TRAP_NR);
> + current->thread.bad_cause = utask->autask.saved_cause;
>
> instruction_pointer_set(regs, utask->vaddr + auprobe->insn_size);
>
> @@ -102,6 +103,7 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> {
> struct uprobe_task *utask = current->utask;
>
> + current->thread.bad_cause = utask->autask.saved_cause;
> /*
> * Task has received a fatal signal, so reset back to probbed
> * address.
>
Hi Oleg and Srikar,
Could you please review this patch, thank you.
Thanks,
Tiezhu
Powered by blists - more mailing lists