On Sun, 2015-01-18 at 00:04 +0100, Niels Möller wrote:
nisse@lysator.liu.se (Niels Möller) writes:
I think I'm going to add an environment variable to override the cpu detection, so different variants can be checked easily at runtime.
Say we add a secure_getenv("NETTLE_FAT_OVERRIDE") in the fat initialization. What should it look like? Some alternatives:
- Specify substitute values to replace result of the cpuid calls?
- A list of feature keywords?
- A list of function:variant, where each entry specifies an override for the particular function?
For gnutls I have an environment variable which is interpreted as an alternative CPUID. E.g. you can put a flag with the following in GNUTLS_CPUID_OVERRIDE: 0x1: Disable all run-time detected optimizations 0x2: Enable AES-NI 0x4: Enable SSSE3 0x8: Enable PCLMUL 0x100000: Enable VIA padlock 0x200000: Enable VIA PHE 0x400000: Enable VIA PHE SHA512