lkml.org 
[lkml]   [2023]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] MIPS: uprobes: Restore thread.trap_nr
On 04/23, Tiezhu Yang wrote:
>
> Cc:
> Oleg Nesterov <oleg@redhat.com>
> Srikar Dronamraju <srikar@linux.vnet.ibm.com>
>
> On 04/23/2023 11:08 AM, Bagas Sanjaya wrote:
> >On Sun, Apr 23, 2023 at 09:38:03AM +0800, Tiezhu Yang wrote:
> >>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.
> >
> >I'm confused (please fix up grammar, spelling, and punctuation). Can you
> >explain why thread.trap_nr should be restored somewhere else? Also, what
> >x86/powerpc changes as reference?
> >
>
> Here is the related first commit for x86 in 2012:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0326f5a94dde
>
> When xol insn itself triggers the signal, restart the original insn,
> in this case, UTASK_SSTEP_TRAPPED is set [1], it does *abort_xol()
> instead of *post_xol() [2], then should do the restore operations.

Yes... for example, if the uprobed task was killed abort() should restore
the state and (in particular) change ->trap_nr from UPROBE_TRAP_NR back to
->saved_trap_nr.

So the patch looks fine to me.

Oleg.

\
 
 \ /
  Last update: 2023-04-24 13:10    [W:0.036 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site