From: Catalin Marinas <catalin.marinas@arm.com>
To: Jungseok Lee <jungseoklee85@gmail.com>
Cc: James Morse <james.morse@arm.com>,
Mark Rutland <Mark.Rutland@arm.com>,
Will Deacon <will.deacon@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"takahiro.akashi@linaro.org" <takahiro.akashi@linaro.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] arm64: Introduce IRQ stack
Date: Thu, 17 Sep 2015 18:07:05 +0100 [thread overview]
Message-ID: <20150917170705.GQ25444@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <8C4599C6-E5F8-4527-AAFF-9FEF295526BB@gmail.com>
On Thu, Sep 17, 2015 at 09:36:04PM +0900, Jungseok Lee wrote:
> On Sep 17, 2015, at 7:33 PM, James Morse wrote:
> > On 16/09/15 12:25, Will Deacon wrote:
> >> On Sun, Sep 13, 2015 at 03:42:17PM +0100, Jungseok Lee wrote:
> >>> diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
> >>> index dcd06d1..44839c0 100644
> >>> --- a/arch/arm64/include/asm/thread_info.h
> >>> +++ b/arch/arm64/include/asm/thread_info.h
> >>> @@ -73,8 +73,11 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__;
> >>>
> >>> static inline struct thread_info *current_thread_info(void)
> >>> {
> >>> - return (struct thread_info *)
> >>> - (current_stack_pointer & ~(THREAD_SIZE - 1));
> >>> + unsigned long sp_el0;
> >>> +
> >>> + asm volatile("mrs %0, sp_el0" : "=r" (sp_el0));
> >>> +
> >>> + return (struct thread_info *)(sp_el0 & ~(THREAD_SIZE - 1));
> >>
> >> This looks like it will generate worse code than our current implementation,
> >> thanks to the asm volatile. Maybe just add something like a global
> >> current_stack_pointer_el0?
[...]
> --- a/arch/arm64/include/asm/thread_info.h
> +++ b/arch/arm64/include/asm/thread_info.h
> @@ -77,7 +77,7 @@ static inline struct thread_info *current_thread_info(void)
>
> asm volatile("mrs %0, sp_el0" : "=r" (sp_el0));
>
> - return (struct thread_info *)(sp_el0 & ~(THREAD_SIZE - 1));
> + return (struct thread_info *)sp_el0;
> }
This makes sense, since we just use sp_el0 as a scratch register, store
the current thread_info address directly. But, as James mentioned, I
don't think you need asm volatile, just asm (it has a small impact in my
tests).
--
Catalin
next prev parent reply other threads:[~2015-09-17 17:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-13 14:42 Jungseok Lee
2015-09-16 11:25 ` Will Deacon
2015-09-17 10:33 ` James Morse
2015-09-17 10:48 ` Catalin Marinas
2015-09-17 12:36 ` Jungseok Lee
2015-09-17 17:07 ` Catalin Marinas [this message]
2015-09-18 13:02 ` Jungseok Lee
2015-09-17 11:17 ` Catalin Marinas
2015-09-17 13:17 ` Jungseok Lee
2015-09-17 13:22 ` Jungseok Lee
2015-09-17 16:21 ` Catalin Marinas
2015-09-18 12:57 ` Jungseok Lee
2015-09-18 13:44 ` James Morse
2015-09-18 15:03 ` Catalin Marinas
2015-09-18 15:31 ` Catalin Marinas
2015-09-19 8:44 ` Jungseok Lee
2015-09-21 9:25 ` Catalin Marinas
2015-09-21 12:14 ` Jungseok Lee
2015-09-18 13:46 ` James Morse
2015-09-19 8:20 ` Jungseok Lee
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=20150917170705.GQ25444@e104818-lin.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=Mark.Rutland@arm.com \
--cc=james.morse@arm.com \
--cc=jungseoklee85@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=takahiro.akashi@linaro.org \
--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 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®