diff options
author | Jungseok Lee <jungseoklee85@gmail.com> | 2015-12-04 11:02:25 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-12-08 11:40:48 +0000 |
commit | 6cdf9c7ca687e01840d0215437620a20263012fc (patch) | |
tree | 096f89d35adbe535b681e885c0214ea9eee7b463 /arch/arm64/kernel/sleep.S | |
parent | 5db4fd8c52810bd9740c1240ebf89223b171aa70 (diff) | |
download | talos-op-linux-6cdf9c7ca687e01840d0215437620a20263012fc.tar.gz talos-op-linux-6cdf9c7ca687e01840d0215437620a20263012fc.zip |
arm64: Store struct thread_info in sp_el0
There is need for figuring out how to manage struct thread_info data when
IRQ stack is introduced. struct thread_info information should be copied
to IRQ stack under the current thread_info calculation logic whenever
context switching is invoked. This is too expensive to keep supporting
the approach.
Instead, this patch pays attention to sp_el0 which is an unused scratch
register in EL1 context. sp_el0 utilization not only simplifies the
management, but also prevents text section size from being increased
largely due to static allocated IRQ stack as removing masking operation
using THREAD_SIZE in many places.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jungseok Lee <jungseoklee85@gmail.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/sleep.S')
-rw-r--r-- | arch/arm64/kernel/sleep.S | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kernel/sleep.S b/arch/arm64/kernel/sleep.S index f586f7c875e2..e33fe33876ab 100644 --- a/arch/arm64/kernel/sleep.S +++ b/arch/arm64/kernel/sleep.S @@ -173,6 +173,9 @@ ENTRY(cpu_resume) /* load physical address of identity map page table in x1 */ adrp x1, idmap_pg_dir mov sp, x2 + /* save thread_info */ + and x2, x2, #~(THREAD_SIZE - 1) + msr sp_el0, x2 /* * cpu_do_resume expects x0 to contain context physical address * pointer and x1 to contain physical address of 1:1 page tables |