[PATCH v2] um: enable the use of optimized xor routines in UML

Anton Ivanov anton.ivanov at cambridgegreys.com
Thu Nov 12 09:18:50 EST 2020


On 12/11/2020 11:09, Richard Weinberger wrote:
> Anton,
>
> ----- Ursprüngliche Mail -----
>> Von: "anton ivanov" <anton.ivanov at cambridgegreys.com>
>> An: "linux-um" <linux-um at lists.infradead.org>
>> CC: "richard" <richard at nod.at>, "anton ivanov" <anton.ivanov at cambridgegreys.com>
>> Gesendet: Donnerstag, 12. November 2020 11:33:37
>> Betreff: [PATCH v2] um: enable the use of optimized xor routines in UML
>> From: Anton Ivanov <anton.ivanov at cambridgegreys.com>
>>
>> This patch enable the use of optimized xor routines from the x86
>> tree as well as supply the necessary macros for them to be used in
>> UML.
>>
>> The macros supply several "fake" flags and definitions to allow
>> using the x86 files "as is".
>>
>> This patchset implements only the flags needed for the optimized
>> strings.h, xor.h and checksum.h implementations instead of
>> trying to copy the entire x86 flags environment.
> So, the plan is using xor methods from arch/x86 and string methods
> from glibc?

Atomics also need to come from arch/x86. That is another one. We fall back to generic atomics which are along the lines of:

interrupts_off

do atomic op

interrupts_on

That is very expensive especially compared to an existing proper atomic op.

We can do it only on 64 bit though, the 64 bit atomics on 32bit x86 use alternatives to switch between versions - it is the same problem as with string.h

This squeezes a few cycles here and there too. It is not particularly noticeable though. The gain is within "experimental error".

Patch will follow shortly.

>
> Thanks,
> //richard
>
> _______________________________________________
> linux-um mailing list
> linux-um at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-um

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/




More information about the linux-um mailing list