[PATCH] XOR implementation for ARMv8

Ard Biesheuvel ard.biesheuvel at linaro.org
Wed Jun 24 01:51:06 PDT 2015

On 24 June 2015 at 10:29, Jérôme Forissier <jerome.forissier at linaro.org> wrote:
> On 06/24/2015 09:00 AM, 刘晓东 wrote:
>> Use the 128-bit SIMD registers and SIMD arithmetic instructions for XOR calculation in assembly language.
> Don't you need kernel_neon_begin()/kernel_neon_end() somewhere? (see
> Documentation/arm/kernel_mode_neon.txt).

Jerome is right: use of this driver will corrupt the FP/SIMD state of
arbitrary userland tasks if you don't explicitly claim the NEON for
in-kernel use by calling kernel_neon_begin)_ and end()

Since XOR may be called in interrupt context, this could add a fixed
overhead to each call, even if you are calling the function many times
in a row. This means you may be better off using even fewer registers,
and use kernel_neon_begin_partial() instead.

May I ask what kind of core you tested this on?


More information about the linux-arm-kernel mailing list