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

Anton Ivanov anton.ivanov at cambridgegreys.com
Thu Nov 12 06:19:01 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?

That is my proposal.

XOR uses a function table, there is no runtime patching so we can just pull it in and "cheat" a bit on the macros so that we do not have to implement the whole 32+ bytes of Intel features and bugs.

strings.h, however, contain a number of functions which use runtime patching in x86. We need to implement this which actually requires pulling all x86 features, because they are tagged in the alternatives table by "CPU feature". It is easier to pull the glibc ones instead. It also does not prevent us from implementing the patching at a later date - it is an alternative implementation.

Checksum, if we do it, is just a reorg and removal of the duplicated code. We have a lot of snippets from the x86 tree cut-n-pasted into our files under x86/um/. We should probably clean it up. It is just a cleanup though, there is no performance advantage there.

>
> 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