diff options
author | Dave Martin <Dave.Martin@arm.com> | 2018-04-12 12:32:35 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-05-25 07:28:29 -0400 |
commit | 9a6e594869b29ccec4f99db83c071e4f2dbfc11f (patch) | |
tree | 49b80089a1074ee487be3f88326ce46f77c9cccf /arch/arm64/kernel | |
parent | 2cf97d46dafbbbbc9a9a3dc5eca01020c6be22d8 (diff) |
arm64/sve: Move sve_pffr() to fpsimd.h and make inline
In order to make sve_save_state()/sve_load_state() more easily
reusable and to get rid of a potential branch on context switch
critical paths, this patch makes sve_pffr() inline and moves it to
fpsimd.h.
<asm/processor.h> must be included in fpsimd.h in order to make
this work, and this creates an #include cycle that is tricky to
avoid without modifying core code, due to the way the PR_SVE_*()
prctl helpers are included in the core prctl implementation.
Instead of breaking the cycle, this patch defers inclusion of
<asm/fpsimd.h> in <asm/processor.h> until the point where it is
actually needed: i.e., immediately before the prctl definitions.
No functional change.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kernel')
-rw-r--r-- | arch/arm64/kernel/fpsimd.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 842b2ad08bec..e60c3a28380f 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c | |||
@@ -161,18 +161,6 @@ static void sve_free(struct task_struct *task) | |||
161 | __sve_free(task); | 161 | __sve_free(task); |
162 | } | 162 | } |
163 | 163 | ||
164 | |||
165 | /* Offset of FFR in the SVE register dump */ | ||
166 | static size_t sve_ffr_offset(int vl) | ||
167 | { | ||
168 | return SVE_SIG_FFR_OFFSET(sve_vq_from_vl(vl)) - SVE_SIG_REGS_OFFSET; | ||
169 | } | ||
170 | |||
171 | static void *sve_pffr(struct thread_struct *thread) | ||
172 | { | ||
173 | return (char *)thread->sve_state + sve_ffr_offset(thread->sve_vl); | ||
174 | } | ||
175 | |||
176 | static void change_cpacr(u64 val, u64 mask) | 164 | static void change_cpacr(u64 val, u64 mask) |
177 | { | 165 | { |
178 | u64 cpacr = read_sysreg(CPACR_EL1); | 166 | u64 cpacr = read_sysreg(CPACR_EL1); |