[PATCH] raid6/altivec: adding vpermxor implementation for raid6 Q syndrome
Michael Ellerman
mpe at ellerman.id.au
Tue Apr 4 20:04:44 AEST 2017
Daniel Axtens <dja at axtens.net> writes:
>> In that function, the flow is:
>> pagefault_disable();
>> enable_kernel_altivec();
>> <vectorised function>
>> pagefault_enable();
>>
>> There are a few things that it would be nice (but by no means essential)
>> to find out:
>> - what is the difference between pagefault and prempt enable/disable
>> - is it required to disable altivec after the end of the function or
>> can we leave that enabled?
>
> Answering my own question here, dc4fbba11e46 ("powerpc: Create
> disable_kernel_{fp,altivec,vsx,spe}()") adds the disable_ function, and
> it's a no-op except under debug conditions. So it should stay.
Yeah enabling altivec for use in the kernel requires saving the
userspace altivec state first (so we don't clobber it).
But once we've enabled it in the kernel, we can just leave it enabled
until we return to userspace and save the cost of disabling it. There's
a small risk that leaving altivec enabled allows some other kernel code
to use altivec when it shouldn't, hence the debug option to make
disable_kernel_altivec() actually disable it.
cheers
More information about the Linuxppc-dev
mailing list