From: oleg@redhat.com (Oleg Nesterov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm64: Add uprobe support
Date: Thu, 25 Aug 2016 15:33:25 +0200 [thread overview]
Message-ID: <20160825133325.GA7653@redhat.com> (raw)
In-Reply-To: <20160824155649.GG16944@arm.com>
On 08/24, Will Deacon wrote:
>
> On Wed, Aug 24, 2016 at 05:47:11PM +0200, Oleg Nesterov wrote:
> > On 08/24, Pratyush Anand wrote:
> > >
> > > > I don't think we want user_{enable,disable{_single_step in the long term,
> > > > please look at 9bd1190a11c9d2 "uprobes/x86: Do not (ab)use TIF_SINGLESTEP
> > > > /user_*_single_step() for single-stepping". it seems that ARM64 sets/clears
> > > > TIF_SINGLESTEP. You can also lool at saved_tf logic, probably ARM64 needs
> > > > the same.
> > >
> > > IIUC, then you mean that TIF_SINGLESTEP is a per task flag,
> >
> > Yes, and nobody but ptrace should use it, otherwise ptrace/uprobes can confuse
> > each other. And uprobes simply doesn't need to set/clear it.
>
> We're already using it for kprobes, hw_breakpoint and kgdb as well as
> ptrace, so I'd rather uprobes either followed existing practice, or we
> converted everybody off the current code.
And perhaps this is fine for arm64, I do not know.
> In what way do things get confused?
Say, arch_uprobe_post_xol() should not blindly do user_disable_single_step(),
this can confuse ptrace if TIF_SINGLESTEP was set by debugger which wants
to step over the probed insn.
> > I can't really answer since I know nothing about arm. x86 just needs to set
> > X86_EFLAGS_TF, I guess arm needs to modify some register too?
>
> We have {user,kernel}_{enable,disable}_single_step for managing the various
> registers controlling the single-step state machine on arm64.
Yes, and perhaps uprobes can just do set_regs_spsr_ss() ? I never looked into
arch/arm64/, but it seems that we only need to ensure that call_step_hook()
will be called even if user_mode() == T, why do we need TIF_SINGLESTEP ?
Nevermind. I can be easily wrong and let me repeat that I agree with
user_{enable,disable}_single_step in the initial version in any case.
Oleg.
next prev parent reply other threads:[~2016-08-25 13:33 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 5:30 [PATCH 0/5] ARM64: Uprobe support added Pratyush Anand
2016-08-02 5:30 ` [PATCH 1/5] arm64: kprobe: protect/rename few definitions to be reused by uprobe Pratyush Anand
2016-08-02 5:30 ` [PATCH 2/5] arm64: kgdb_step_brk_fn: ignore other's exception Pratyush Anand
2016-08-02 5:30 ` [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Pratyush Anand
2016-09-06 16:11 ` Catalin Marinas
2016-09-06 21:36 ` David Long
2016-09-07 4:47 ` Pratyush Anand
2016-09-07 13:41 ` Catalin Marinas
2016-08-02 5:30 ` [PATCH 4/5] arm64: Handle TRAP_BRKPT " Pratyush Anand
2016-09-06 16:34 ` Catalin Marinas
2016-08-02 5:30 ` [PATCH 5/5] arm64: Add uprobe support Pratyush Anand
2016-08-09 18:49 ` Oleg Nesterov
2016-08-24 7:13 ` Pratyush Anand
2016-08-24 15:47 ` Oleg Nesterov
2016-08-24 15:56 ` Will Deacon
2016-08-25 13:33 ` Oleg Nesterov [this message]
2016-09-20 16:59 ` Catalin Marinas
2016-09-21 11:00 ` Pratyush Anand
2016-09-21 17:04 ` Catalin Marinas
2016-09-22 3:23 ` Pratyush Anand
2016-09-22 16:50 ` Catalin Marinas
2016-09-23 4:12 ` Pratyush Anand
2016-09-23 13:05 ` Catalin Marinas
2016-09-25 17:02 ` Pratyush Anand
2016-09-26 11:01 ` Catalin Marinas
2016-09-26 13:03 ` Pratyush Anand
2016-09-27 13:51 ` Catalin Marinas
2016-09-27 15:03 ` Pratyush Anand
2016-09-28 17:12 ` Catalin Marinas
2016-08-24 7:26 ` [PATCH 0/5] ARM64: Uprobe support added Pratyush Anand
2016-09-20 2:51 ` Pratyush Anand
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=20160825133325.GA7653@redhat.com \
--to=oleg@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).