linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: uprobes: Restore thread.trap_nr
@ 2023-04-23  1:38 Tiezhu Yang
  2023-04-23  3:08 ` Bagas Sanjaya
  2023-04-24 11:32 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 5+ messages in thread
From: Tiezhu Yang @ 2023-04-23  1:38 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, loongson-kernel

thread.trap_nr is saved in arch_uprobe_pre_xol(), it should be restored
in arch_uprobe_{post,abort}_xol() accordingly, actually it was only done
in the post function, just do it in the abort function too, this change
is similar with x86 and powerpc.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/mips/kernel/uprobes.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index 6b630ed..401b148 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -191,6 +191,7 @@ void arch_uprobe_abort_xol(struct arch_uprobe *aup,
 {
 	struct uprobe_task *utask = current->utask;
 
+	current->thread.trap_nr = utask->autask.saved_trap_nr;
 	instruction_pointer_set(regs, utask->vaddr);
 }
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-24 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-23  1:38 [PATCH] MIPS: uprobes: Restore thread.trap_nr Tiezhu Yang
2023-04-23  3:08 ` Bagas Sanjaya
2023-04-23 10:39   ` Tiezhu Yang
2023-04-24 11:07     ` Oleg Nesterov
2023-04-24 11:32 ` Thomas Bogendoerfer

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).