Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1227847
| From | Jungseok Lee <jungseoklee85@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] arm64: Introduce IRQ stack |
| Date | 2015-09-18 15:10 +0200 |
| Message-ID | <qa3Am-3u2-13@gated-at.bofh.it> (permalink) |
| References | <q8gLo-29u-1@gated-at.bofh.it> <q9j4t-31b-13@gated-at.bofh.it> <q9ELD-TQ-3@gated-at.bofh.it> <q9GDN-3D9-17@gated-at.bofh.it> <q9KR5-1yz-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sep 18, 2015, at 2:07 AM, Catalin Marinas wrote:
> 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).
I will squash this change into the original one without volatile.
Best Regards
Jungseok Lee--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-13 16:50 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Will Deacon <will.deacon@arm.com> - 2015-09-16 13:30 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-17 12:40 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 12:50 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 14:40 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 19:10 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-18 15:10 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 13:20 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 15:20 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-17 15:30 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-17 18:30 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-18 15:00 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-18 15:50 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-18 17:10 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-18 17:40 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-19 10:50 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Catalin Marinas <catalin.marinas@arm.com> - 2015-09-21 11:30 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-21 14:20 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack James Morse <james.morse@arm.com> - 2015-09-18 15:50 +0200
Re: [PATCH v2] arm64: Introduce IRQ stack Jungseok Lee <jungseoklee85@gmail.com> - 2015-09-19 10:30 +0200
csiph-web