aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/thread_info.h
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2016-09-08 13:55:38 +0100
committerWill Deacon <will.deacon@arm.com>2016-09-09 11:43:50 +0100
commitadf7589997927b1d84a5d003027b866bbef61ef2 (patch)
treef3bb449f2bda4e8992983b5d87e7dab1415fa17e /arch/arm64/include/asm/thread_info.h
parentarm64/kvm: use {read,write}_sysreg() (diff)
downloadlinux-dev-adf7589997927b1d84a5d003027b866bbef61ef2.tar.xz
linux-dev-adf7589997927b1d84a5d003027b866bbef61ef2.zip
arm64: simplify sysreg manipulation
A while back we added {read,write}_sysreg accessors to handle accesses to system registers, without the usual boilerplate asm volatile, temporary variable, etc. This patch makes use of these across arm64 to make code shorter and clearer. For sequences with a trailing ISB, the existing isb() macro is also used so that asm blocks can be removed entirely. A few uses of inline assembly for msr/mrs are left as-is. Those manipulating sp_el0 for the current thread_info value have special clobber requiremends. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/thread_info.h')
-rw-r--r--arch/arm64/include/asm/thread_info.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index abd64bd1f6d9..e9ea5a6bd449 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -75,6 +75,9 @@ static inline struct thread_info *current_thread_info(void) __attribute_const__;
/*
* struct thread_info can be accessed directly via sp_el0.
+ *
+ * We don't use read_sysreg() as we want the compiler to cache the value where
+ * possible.
*/
static inline struct thread_info *current_thread_info(void)
{