All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Will Deacon <will.deacon@arm.com>
Cc: "Haibo.Xu" <haibo.xu@arm.com>,
	catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, nd@arm.com, jdike@addtoit.com
Subject: Re: [PATCH] arm64/ptrace: add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support
Date: Mon, 03 Sep 2018 18:40:51 +0200	[thread overview]
Message-ID: <102400624.EOB2phcGqB@blindfold> (raw)
In-Reply-To: <20180903163103.GC6954@arm.com>

Am Montag, 3. September 2018, 18:31:03 CEST schrieb Will Deacon:
> On Mon, Sep 03, 2018 at 02:23:17PM +0800, Haibo.Xu wrote:
> > Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support on ARM64.
> > This copies the x86 semantics for invoking ptrace hooks, and have
> > been verified on ARM64 machine.
> > 
> > Signed-off-by: Haibo.Xu <haibo.xu@arm.com>
> > Signed-off-by: Bin.Lu <bin.lu@arm.com>
> > ---
> >  arch/arm64/include/asm/thread_info.h |  5 ++++-
> >  arch/arm64/include/uapi/asm/ptrace.h |  2 ++
> >  arch/arm64/kernel/ptrace.c           | 17 +++++++++++++++++
> >  3 files changed, 23 insertions(+), 1 deletion(-)
> 
> What is PTRACE_SYSEMU and what is its semantics? Why isn't it done in the
> core ptrace code?

It is an optimization added for UserModeLinux many years ago.
PTRACE_SYSEMU basically allows you to handle system calls in user space
without the kernel seeing them.
Before that UML had to render every system call into a no-op, e.h. getpid().
This was complicated and slow.

The ptrace() manpage has a section on PTRACE_SYSEMU, more documentation on the
semantics is not available.

And yes, I think this should also done in the core. Like many other ptrace() areas
this needs a cleanup. ;-)

I wonder what Haibo Xu want to do with PTRACE_SYSEMU on arm64.
Are you porting UML or gvisor to arm64?

Thanks,
//richard



WARNING: multiple messages have this Message-ID (diff)
From: richard@nod.at (Richard Weinberger)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64/ptrace: add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support
Date: Mon, 03 Sep 2018 18:40:51 +0200	[thread overview]
Message-ID: <102400624.EOB2phcGqB@blindfold> (raw)
In-Reply-To: <20180903163103.GC6954@arm.com>

Am Montag, 3. September 2018, 18:31:03 CEST schrieb Will Deacon:
> On Mon, Sep 03, 2018 at 02:23:17PM +0800, Haibo.Xu wrote:
> > Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support on ARM64.
> > This copies the x86 semantics for invoking ptrace hooks, and have
> > been verified on ARM64 machine.
> > 
> > Signed-off-by: Haibo.Xu <haibo.xu@arm.com>
> > Signed-off-by: Bin.Lu <bin.lu@arm.com>
> > ---
> >  arch/arm64/include/asm/thread_info.h |  5 ++++-
> >  arch/arm64/include/uapi/asm/ptrace.h |  2 ++
> >  arch/arm64/kernel/ptrace.c           | 17 +++++++++++++++++
> >  3 files changed, 23 insertions(+), 1 deletion(-)
> 
> What is PTRACE_SYSEMU and what is its semantics? Why isn't it done in the
> core ptrace code?

It is an optimization added for UserModeLinux many years ago.
PTRACE_SYSEMU basically allows you to handle system calls in user space
without the kernel seeing them.
Before that UML had to render every system call into a no-op, e.h. getpid().
This was complicated and slow.

The ptrace() manpage has a section on PTRACE_SYSEMU, more documentation on the
semantics is not available.

And yes, I think this should also done in the core. Like many other ptrace() areas
this needs a cleanup. ;-)

I wonder what Haibo Xu want to do with PTRACE_SYSEMU on arm64.
Are you porting UML or gvisor to arm64?

Thanks,
//richard

  reply	other threads:[~2018-09-03 16:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-03  6:23 [PATCH] arm64/ptrace: add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support Haibo.Xu
2018-09-03 16:31 ` Will Deacon
2018-09-03 16:31   ` Will Deacon
2018-09-03 16:40   ` Richard Weinberger [this message]
2018-09-03 16:40     ` Richard Weinberger
2018-09-03 16:57     ` Will Deacon
2018-09-03 16:57       ` Will Deacon
2018-09-04  2:11       ` 答复: " Haibo Xu (Arm Technology China)
2018-09-04  2:11         ` Haibo Xu (Arm Technology China)
2018-09-04 19:45         ` Richard Weinberger
2018-09-04 19:45           ` Richard Weinberger
2018-09-05 10:21           ` 答复: " Haibo Xu (Arm Technology China)
2018-09-05 10:21             ` Haibo Xu (Arm Technology China)
2018-10-16  2:54           ` Haibo Xu (Arm Technology China)
2018-10-16  2:54             ` Haibo Xu (Arm Technology China)

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=102400624.EOB2phcGqB@blindfold \
    --to=richard@nod.at \
    --cc=catalin.marinas@arm.com \
    --cc=haibo.xu@arm.com \
    --cc=jdike@addtoit.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nd@arm.com \
    --cc=will.deacon@arm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.