Post by Otto KekäläinenAre there any ARM experts here interested in helping MariaDB 10.11 run
better on armel/armhf?
The issue is explained well in upstream bug
https://jira.mariadb.org/browse/MDEV-30411 but upstream is not
investing developers/testing into armel/armhf, so I wanted to check if
anybody here could help.
Basically the upstream header
https://github.com/MariaDB/server/tree/10.11/include/my_rdtsc.h needs
to be extended to handle armel/armhf (and maybe also mipsel and
mips64el) properly so it would make all official Debian architectures
happy.
I believe Andy Polyakov performed the heavy lifting for OpenSSL. I
would check the OpenSSL code. It should not be much more than a
copy/paste. Or if you don't like the license, convert the *.pl file to
a source file to see how OpenSSL does it, then write your own.
openssl$ grep -IR rdtsc | ...
crypto/alphacpuid.pl:.end OPENSSL_rdtsc
crypto/alphacpuid.pl:.ent OPENSSL_rdtsc
crypto/alphacpuid.pl:.globl OPENSSL_rdtsc
crypto/alphacpuid.pl:OPENSSL_rdtsc:
crypto/armcap.c:uint32_t OPENSSL_rdtsc(void)
crypto/c64xpluscpuid.pl: .asg OPENSSL_rdtsc,_OPENSSL_rdtsc
crypto/c64xpluscpuid.pl: .global _OPENSSL_rdtsc
crypto/c64xpluscpuid.pl:_OPENSSL_rdtsc:
crypto/cpuid.c:uint32_t OPENSSL_rdtsc(void)
crypto/ia64cpuid.S:.endp OPENSSL_rdtsc#
crypto/ia64cpuid.S:.global OPENSSL_rdtsc#
crypto/ia64cpuid.S:.proc OPENSSL_rdtsc#
crypto/ia64cpuid.S:OPENSSL_rdtsc:
crypto/loongarch64cpuid.pl:# uint32_t OPENSSL_rdtsc(void)
crypto/loongarch64cpuid.pl:.globl OPENSSL_rdtsc
crypto/loongarch64cpuid.pl:.type OPENSSL_rdtsc,\@function
crypto/loongarch64cpuid.pl:OPENSSL_rdtsc:
crypto/pariscid.pl: .EXPORT OPENSSL_rdtsc,ENTRY
crypto/pariscid.pl:OPENSSL_rdtsc
crypto/ppccap.c: OPENSSL_rdtsc_mfspr268();
crypto/ppccap.c: OPENSSL_rdtsc_mftb();
crypto/ppccap.c: return OPENSSL_rdtsc_mfspr268();
crypto/ppccap.c: return OPENSSL_rdtsc_mftb();
crypto/ppccap.c:long OPENSSL_rdtsc_mfspr268(void);
crypto/ppccap.c:long OPENSSL_rdtsc_mftb(void);
crypto/ppccap.c:uint32_t OPENSSL_rdtsc(void)
crypto/ppccpuid.pl:.OPENSSL_rdtsc_mfspr268:
crypto/ppccpuid.pl:.OPENSSL_rdtsc_mftb:
crypto/ppccpuid.pl:.globl .OPENSSL_rdtsc_mfspr268
crypto/ppccpuid.pl:.globl .OPENSSL_rdtsc_mftb
crypto/riscvcap.c:uint32_t OPENSSL_rdtsc(void)
crypto/s390xcpuid.pl:.globl OPENSSL_rdtsc
crypto/s390xcpuid.pl:.size OPENSSL_rdtsc,.-OPENSSL_rdtsc
crypto/s390xcpuid.pl:.type OPENSSL_rdtsc,\@function
crypto/s390xcpuid.pl:OPENSSL_rdtsc:
crypto/sparcv9cap.c:uint32_t OPENSSL_rdtsc(void)
crypto/x86_64cpuid.pl: rdtsc
crypto/x86_64cpuid.pl: rdtsc # collect 1st diff
crypto/x86_64cpuid.pl: rdtsc # collect 1st tick
crypto/x86_64cpuid.pl:.Loop: rdtsc
crypto/x86_64cpuid.pl:.globl OPENSSL_rdtsc
crypto/x86_64cpuid.pl:.size OPENSSL_rdtsc,.-OPENSSL_rdtsc
crypto/x86_64cpuid.pl:.type OPENSSL_rdtsc,\@abi-omnipotent
crypto/x86_64cpuid.pl:OPENSSL_rdtsc:
crypto/x86cpuid.pl: &rdtsc ();
You can convert a *.pl file to a source file that can be assembled or
compiled by following the instructions at
https://wiki.openssl.org/index.php/Cryptogams_AES or
https://wiki.openssl.org/index.php/Cryptogams_SHA.
Jeff