]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/sve: Write ZCR_EL1 on context switch only if changed
authorDave Martin <Dave.Martin@arm.com>
Mon, 14 May 2018 17:51:09 +0000 (18:51 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 17 May 2018 17:19:53 +0000 (18:19 +0100)
commitac03958b88ea8232bdaa3e54b1bd3f1eef6e0b28
tree2cc7356909e076e77d1fe961f9c90f2f0c8f0595
parente05739aee27ce6e339daf8521e5bdd869ab9b466
arm64/sve: Write ZCR_EL1 on context switch only if changed

Writes to ZCR_EL1 are self-synchronising, and so may be expensive
in typical implementations.

This patch adopts the approach used for costly system register
writes elsewhere in the kernel: the system register write is
suppressed if it would not change the stored value.

Since the common case will be that of switching between tasks that
use the same vector length as one another, prediction hit rates on
the conditional branch should be reasonably good, with lower
expected amortised cost than the unconditional execution of a
heavyweight self-synchronising instruction.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/fpsimdmacros.h
arch/arm64/kernel/entry-fpsimd.S