All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Pratyush Anand <panand@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk,
	catalin.marinas@arm.com, will.deacon@arm.com,
	linux-kernel@vger.kernel.org, wcohen@redhat.com,
	dave.long@linaro.org, steve.capper@linaro.org,
	srikar@linux.vnet.ibm.com, vijaya.kumar@caviumnetworks.com,
	Shi Yang <yang.shi@linaro.org>,
	Andre Przywara <andre.przywara@arm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Ashok Kumar <ashoks@broadcom.com>,
	James Morse <james.morse@arm.com>,
	Jungseok Lee <jungseoklee85@gmail.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Sandeepa Prabhu <sandeepa.s.prabhu@gmail.com>,
	Shaokun Zhang <zhangshaokun@hisilicon.com>,
	"Suzuki K. Poulose" <suzuki.poulose@arm.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>
Subject: Re: [PATCH 5/5] arm64: Add uprobe support
Date: Tue, 9 Aug 2016 20:49:44 +0200	[thread overview]
Message-ID: <20160809184943.GA17112@redhat.com> (raw)
In-Reply-To: <abaac6ebaa5dd63889803ec568663bc8c8c65b02.1470114993.git.panand@redhat.com>

On 08/02, Pratyush Anand wrote:
>
> This patch adds support for uprobe on ARM64 architecture.

I know nothing about ARM, so I can't actually review this change.
But it looks good to me ;)

Just one note,

> +int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> +{
> +	struct uprobe_task *utask = current->utask;
> +
> +	/* saved fault code is restored in post_xol */
> +	utask->autask.saved_fault_code = current->thread.fault_code;
> +
> +	/* An invalid fault code between pre/post xol event */
> +	current->thread.fault_code = UPROBE_INV_FAULT_CODE;
> +
> +	/* Instruction point to execute ol */
> +	instruction_pointer_set(regs, utask->xol_vaddr);
> +
> +	user_enable_single_step(current);

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.

However, I agree we can do this later and initial version can use these
ptrace helpers.

Oleg.

WARNING: multiple messages have this Message-ID (diff)
From: oleg@redhat.com (Oleg Nesterov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm64: Add uprobe support
Date: Tue, 9 Aug 2016 20:49:44 +0200	[thread overview]
Message-ID: <20160809184943.GA17112@redhat.com> (raw)
In-Reply-To: <abaac6ebaa5dd63889803ec568663bc8c8c65b02.1470114993.git.panand@redhat.com>

On 08/02, Pratyush Anand wrote:
>
> This patch adds support for uprobe on ARM64 architecture.

I know nothing about ARM, so I can't actually review this change.
But it looks good to me ;)

Just one note,

> +int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
> +{
> +	struct uprobe_task *utask = current->utask;
> +
> +	/* saved fault code is restored in post_xol */
> +	utask->autask.saved_fault_code = current->thread.fault_code;
> +
> +	/* An invalid fault code between pre/post xol event */
> +	current->thread.fault_code = UPROBE_INV_FAULT_CODE;
> +
> +	/* Instruction point to execute ol */
> +	instruction_pointer_set(regs, utask->xol_vaddr);
> +
> +	user_enable_single_step(current);

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.

However, I agree we can do this later and initial version can use these
ptrace helpers.

Oleg.

  reply	other threads:[~2016-08-09 18:49 UTC|newest]

Thread overview: 62+ 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 ` 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   ` 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   ` Pratyush Anand
2016-08-02  5:30 ` [PATCH 3/5] arm64: Handle TRAP_HWBRKPT for user mode as well Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-09-06 16:11   ` Catalin Marinas
2016-09-06 16:11     ` Catalin Marinas
2016-09-06 21:36     ` David Long
2016-09-06 21:36       ` David Long
2016-09-07  4:47       ` Pratyush Anand
2016-09-07  4:47         ` Pratyush Anand
2016-09-07 13:41       ` Catalin Marinas
2016-09-07 13:41         ` Catalin Marinas
2016-08-02  5:30 ` [PATCH 4/5] arm64: Handle TRAP_BRKPT " Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-09-06 16:34   ` Catalin Marinas
2016-09-06 16:34     ` Catalin Marinas
2016-08-02  5:30 ` [PATCH 5/5] arm64: Add uprobe support Pratyush Anand
2016-08-02  5:30   ` Pratyush Anand
2016-08-09 18:49   ` Oleg Nesterov [this message]
2016-08-09 18:49     ` Oleg Nesterov
2016-08-24  7:13     ` Pratyush Anand
2016-08-24  7:13       ` Pratyush Anand
2016-08-24 15:47       ` Oleg Nesterov
2016-08-24 15:47         ` Oleg Nesterov
2016-08-24 15:56         ` Will Deacon
2016-08-24 15:56           ` Will Deacon
2016-08-25 13:33           ` Oleg Nesterov
2016-08-25 13:33             ` Oleg Nesterov
2016-09-20 16:59   ` Catalin Marinas
2016-09-20 16:59     ` Catalin Marinas
2016-09-21 11:00     ` Pratyush Anand
2016-09-21 11:00       ` Pratyush Anand
2016-09-21 17:04       ` Catalin Marinas
2016-09-21 17:04         ` Catalin Marinas
2016-09-22  3:23         ` Pratyush Anand
2016-09-22  3:23           ` Pratyush Anand
2016-09-22 16:50           ` Catalin Marinas
2016-09-22 16:50             ` Catalin Marinas
2016-09-23  4:12             ` Pratyush Anand
2016-09-23  4:12               ` Pratyush Anand
2016-09-23 13:05               ` Catalin Marinas
2016-09-23 13:05                 ` Catalin Marinas
2016-09-25 17:02                 ` Pratyush Anand
2016-09-25 17:02                   ` Pratyush Anand
2016-09-26 11:01                   ` Catalin Marinas
2016-09-26 11:01                     ` Catalin Marinas
2016-09-26 13:03                     ` Pratyush Anand
2016-09-26 13:03                       ` Pratyush Anand
2016-09-27 13:51                       ` Catalin Marinas
2016-09-27 13:51                         ` Catalin Marinas
2016-09-27 15:03                         ` Pratyush Anand
2016-09-27 15:03                           ` Pratyush Anand
2016-09-28 17:12                           ` Catalin Marinas
2016-09-28 17:12                             ` Catalin Marinas
2016-08-24  7:26 ` [PATCH 0/5] ARM64: Uprobe support added Pratyush Anand
2016-08-24  7:26   ` Pratyush Anand
2016-09-20  2:51   ` 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=20160809184943.GA17112@redhat.com \
    --to=oleg@redhat.com \
    --cc=andre.przywara@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ashoks@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=dave.long@linaro.org \
    --cc=james.morse@arm.com \
    --cc=jungseoklee85@gmail.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=panand@redhat.com \
    --cc=robin.murphy@arm.com \
    --cc=sandeepa.s.prabhu@gmail.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=steve.capper@linaro.org \
    --cc=suzuki.poulose@arm.com \
    --cc=vijaya.kumar@caviumnetworks.com \
    --cc=vladimir.murzin@arm.com \
    --cc=wcohen@redhat.com \
    --cc=will.deacon@arm.com \
    --cc=yang.shi@linaro.org \
    --cc=zhangshaokun@hisilicon.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.