• Dave Martin's avatar
    arm64/sve: Write ZCR_EL1 on context switch only if changed · 159fd7b8
    Dave Martin authored
    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: default avatarDave Martin <Dave.Martin@arm.com>
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    159fd7b8
fpsimdmacros.h 5.66 KB