mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Zhi-zhou Zhang <zhizhou.zh@gmail.com>
Cc: robin.murphy@arm.com, will.deacon@arm.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: add architecture specified current_pt_regs
Date: Thu, 18 Feb 2016 11:58:24 +0000	[thread overview]
Message-ID: <20160218115824.GA2538@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1455796115-7844-1-git-send-email-zhizhou.zh@gmail.com>

On Thu, Feb 18, 2016 at 07:48:35PM +0800, Zhi-zhou Zhang wrote:
> From: zhizhou <zhizhou.zh@gmail.com>
> 
> This patch is based on the implementation of arm. The generic
> current_pt_regs is implemented with current->stack. It need to access
> memory that would be too expensive.

Do you have any performance numbers?

> diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
> index e9e5467..1865d54 100644
> --- a/arch/arm64/include/asm/ptrace.h
> +++ b/arch/arm64/include/asm/ptrace.h
> @@ -185,5 +185,9 @@ static inline int valid_user_regs(struct user_pt_regs *regs)
>  
>  extern unsigned long profile_pc(struct pt_regs *regs);
>  
> +#define current_pt_regs(void) ({ (struct pt_regs *)			\
> +	((current_stack_pointer | (THREAD_SIZE - 1)) - 0xf) - 1;	\
> +})

I don't think this works well with the separate IRQ stack that we merged
in 4.5-rc1. current_thread_info() explicitly uses "sp_el0" while
current_stack_pointer is just "sp" (though I don't think we ever use
current_pt_regs in interrupt context).

-- 
Catalin

  reply	other threads:[~2016-02-18 11:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 11:48 Zhi-zhou Zhang
2016-02-18 11:58 ` Catalin Marinas [this message]
2016-02-19  2:30   ` Zhi-zhou
2016-02-19 10:32     ` Will Deacon
2016-02-19 12:01       ` Zhizhou Zhang

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=20160218115824.GA2538@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will.deacon@arm.com \
    --cc=zhizhou.zh@gmail.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 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®