From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Bagas Sanjaya <bagasdotme@gmail.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@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] MIPS: uprobes: Restore thread.trap_nr
Date: Sun, 23 Apr 2023 18:39:38 +0800 [thread overview]
Message-ID: <f99fe71d-cd97-e641-d637-5e7efbcad5f5@loongson.cn> (raw)
In-Reply-To: <ZEShNUil0gsVlrDo@debian.me>
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.
Maybe Oleg and Srikar could give more detailed backgrounds, thank you.
https://lore.kernel.org/lkml/1682213883-3654-1-git-send-email-yangtiezhu@loongson.cn/
[1]
https://elixir.bootlin.com/linux/latest/source/kernel/events/uprobes.c#L1980
[2]
https://elixir.bootlin.com/linux/latest/source/kernel/events/uprobes.c#L2268
Thanks,
Tiezhu
next prev parent reply other threads:[~2023-04-23 10:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-23 1:38 Tiezhu Yang
2023-04-23 3:08 ` Bagas Sanjaya
2023-04-23 10:39 ` Tiezhu Yang [this message]
2023-04-24 11:07 ` Oleg Nesterov
2023-04-24 11:32 ` Thomas Bogendoerfer
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=f99fe71d-cd97-e641-d637-5e7efbcad5f5@loongson.cn \
--to=yangtiezhu@loongson.cn \
--cc=bagasdotme@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=oleg@redhat.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=tsbogend@alpha.franken.de \
/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
all inboxes | Powered by JetHome®