summaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/assembler.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2021-02-12 14:54:55 +0000
committerWill Deacon <will@kernel.org>2021-02-12 14:54:55 +0000
commitf96a816fa5e5b7bdbfc1802dfb7f8155df2746d0 (patch)
tree837f1f2cb1f866362770ebca1d94814253d3276b /arch/arm64/include/asm/assembler.h
parent88ddf0df1620c67c12f9a950cecf1dac99fb8e08 (diff)
parentd13c613f136c9090f3863c49b2306d57ab59feba (diff)
downloadlinux-f96a816fa5e5b7bdbfc1802dfb7f8155df2746d0.tar.bz2
Merge branch 'for-next/crypto' into for-next/core
Introduce a new macro to allow yielding the vector unit if preemption is required. The initial users of this are being merged via the crypto tree for 5.12. * for-next/crypto: arm64: assembler: add cond_yield macro
Diffstat (limited to 'arch/arm64/include/asm/assembler.h')
-rw-r--r--arch/arm64/include/asm/assembler.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 8cded93f99c3..ca31594d3d6c 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -762,6 +762,22 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU
.Lyield_out_\@ :
.endm
+ /*
+ * Check whether preempt-disabled code should yield as soon as it
+ * is able. This is the case if re-enabling preemption a single
+ * time results in a preempt count of zero, and the TIF_NEED_RESCHED
+ * flag is set. (Note that the latter is stored negated in the
+ * top word of the thread_info::preempt_count field)
+ */
+ .macro cond_yield, lbl:req, tmp:req
+#ifdef CONFIG_PREEMPTION
+ get_current_task \tmp
+ ldr \tmp, [\tmp, #TSK_TI_PREEMPT]
+ sub \tmp, \tmp, #PREEMPT_DISABLE_OFFSET
+ cbz \tmp, \lbl
+#endif
+ .endm
+
/*
* This macro emits a program property note section identifying
* architecture features which require special handling, mainly for