summaryrefslogtreecommitdiffstats
path: root/crypto/x86cpuid.pl
AgeCommit message (Collapse)Author
2020-04-23Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
2020-02-17Also check for errors in x86_64-xlate.pl.David Benjamin
In https://github.com/openssl/openssl/pull/10883, I'd meant to exclude the perlasm drivers since they aren't opening pipes and do not particularly need it, but I only noticed x86_64-xlate.pl, so arm-xlate.pl and ppc-xlate.pl got the change. That seems to have been fine, so be consistent and also apply the change to x86_64-xlate.pl. Checking for errors is generally a good idea. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/10930)
2020-01-22Do not silently truncate files on perlasm errorsDavid Benjamin
If one of the perlasm xlate drivers crashes, OpenSSL's build will currently swallow the error and silently truncate the output to however far the driver got. This will hopefully fail to build, but better to check such things. Handle this by checking for errors when closing STDOUT (which is a pipe to the xlate driver). Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10883)
2019-09-16Unify all assembler file generatorsRichard Levitte
They now generally conform to the following argument sequence: script.pl "$(PERLASM_SCHEME)" [ C preprocessor arguments ... ] \ $(PROCESSOR) <output file> However, in the spirit of being able to use these scripts manually, they also allow for no argument, or for only the flavour, or for only the output file. This is done by only using the last argument as output file if it's a file (it has an extension), and only using the first argument as flavour if it isn't a file (it doesn't have an extension). While we're at it, we make all $xlate calls the same, i.e. the $output argument is always quoted, and we always die on error when trying to start $xlate. There's a perl lesson in this, regarding operator priority... This will always succeed, even when it fails: open FOO, "something" || die "ERR: $!"; The reason is that '||' has higher priority than list operators (a function is essentially a list operator and gobbles up everything following it that isn't lower priority), and since a non-empty string is always true, so that ends up being exactly the same as: open FOO, "something"; This, however, will fail if "something" can't be opened: open FOO, "something" or die "ERR: $!"; The reason is that 'or' has lower priority that list operators, i.e. it's performed after the 'open' call. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9884)
2018-12-06Following the license change, modify the boilerplates in crypto/Richard Levitte
[skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7827)
2018-03-08Fix issues in ia32 RDRAND asm leading to reduced entropyBryan Donlan
This patch fixes two issues in the ia32 RDRAND assembly code that result in a (possibly significant) loss of entropy. The first, less significant, issue is that, by returning success as 0 from OPENSSL_ia32_rdrand() and OPENSSL_ia32_rdseed(), a subtle bias was introduced. Specifically, because the assembly routine copied the remaining number of retries over the result when RDRAND/RDSEED returned 'successful but zero', a bias towards values 1-8 (primarily 8) was introduced. The second, more worrying issue was that, due to a mixup in registers, when a buffer that was not size 0 or 1 mod 8 was passed to OPENSSL_ia32_rdrand_bytes or OPENSSL_ia32_rdseed_bytes, the last (n mod 8) bytes were all the same value. This issue impacts only the 64-bit variant of the assembly. This change fixes both issues by first eliminating the only use of OPENSSL_ia32_rdrand, replacing it with OPENSSL_ia32_rdrand_bytes, and fixes the register mixup in OPENSSL_ia32_rdrand_bytes. It also adds a sanity test for OPENSSL_ia32_rdrand_bytes and OPENSSL_ia32_rdseed_bytes to help catch problems of this nature in the future. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5342)
2017-11-11Many spelling fixes/typo's corrected.Josh Soref
Around 138 distinct errors found and fixed; thanks! Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3459)
2017-05-11Remove filename argument to x86 asm_init.David Benjamin
The assembler already knows the actual path to the generated file and, in other perlasm architectures, is left to manage debug symbols itself. Notably, in OpenSSL 1.1.x's new build system, which allows a separate build directory, converting .pl to .s as the scripts currently do result in the wrong paths. This also avoids inconsistencies from some of the files using $0 and some passing in the filename. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3431)
2017-03-29More typo fixesFdaSilvaYY
Fix some comments too [skip ci] Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3069)
2017-03-13crypto/x86*cpuid.pl: move extended feature detection.Andy Polyakov
Exteneded feature flags were not pulled on AMD processors, as result a number of extensions were effectively masked on Ryzen. Original fix for x86_64cpuid.pl addressed this problem, but messed up processor vendor detection. This fix moves extended feature detection past basic feature detection where it belongs. 32-bit counterpart is harmonized too. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2017-02-28Remove OPENSSL_indirect_call()Benjamin Kaduk
It's undocumented and unused in the tree. The idea seems to have never gained much traction, and can be removed without breaking ABI compatibility. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2800)
2016-10-10Remove trailing whitespace from some files.David Benjamin
The prevailing style seems to not have trailing whitespace, but a few lines do. This is mostly in the perlasm files, but a few C files got them after the reformat. This is the result of: find . -name '*.pl' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.c' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.h' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' Then bn_prime.h was excluded since this is a generated file. Note mkerr.pl has some changes in a heredoc for some help output, but other lines there lack trailing whitespace too. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-15crypto/x86[_64]cpuid.pl: add OPENSSL_ia32_rd[rand|seed]_bytes.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-19Add assembly CRYPTO_memcmp.Andy Polyakov
GH: #102 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20Copyright consolidation: perl filesRich Salz
Add copyright to most .pl files This does NOT cover any .pl file that has other copyright in it. Most of those are Andy's but some are public domain. Fix typo's in some existing files. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-09Unified - adapt the generation of cpuid, uplink and buildinf to use GENERATERichard Levitte
This gets rid of the BEGINRAW..ENDRAW sections in crypto/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Andy Polyakov <appro@openssl.org>
2014-08-09Undo a90081576c94f9f54de1755188a00ccc1760549aRich Salz
Undo unapproved commit that removed DJGPP and WATT32
2014-08-08Remove DJGPP (and therefore WATT32) #ifdef's.Rich Salz
DJGPP is no longer a supported platform. Remove all #ifdef, etc., cases that refer to it. DJGPP also #define'd WATT32, so that is now removed as well.
2014-02-14x86[_64]cpuid.pl: add low-level RDSEED.Andy Polyakov
2013-06-10x86cpuid.pl: fix extended feature flags detection.Andy Polyakov
2013-03-04x86cpuid.pl: make it work with older CPUs.Andy Polyakov
PR: 3005
2012-11-17Extend OPENSSL_ia32cap_P with extra word to accomodate AVX2 capability.Andy Polyakov
2012-08-29x86cpuid.pl: hide symbols [backport from x86_64].Andy Polyakov
2012-06-04Revert random changes from commit#22606.Andy Polyakov
2012-06-03Version skew reduction: trivia (I hope).Ben Laurie
2012-04-28perlasm: fix symptom-less bugs, missing semicolons and 'my' declarations.Andy Polyakov
2012-02-28x86cpuid.pl: fix processor capability detection on pre-586.Andy Polyakov
2011-11-08x86cpuid.pl: compensate for imaginary virtual machines.Andy Polyakov
2011-11-05x86cpuid.pl: don't punish "last-year" OSes on "this-year" CPUs.Andy Polyakov
PR: 2633
2011-06-04x86[_64]cpuid.pl: add function accessing rdrand instruction.Andy Polyakov
2011-05-29x86cpuid.pl: last commit broke platforms with perl with 64-bit integer.Andy Polyakov
2011-05-27x86[_64]cpuid.pl: harmonize usage of reserved bits #20 and #30.Andy Polyakov
2011-05-16x86[_64]cpuid.pl: handle new extensions.Andy Polyakov
2011-04-17Multiple assembler packs: add experimental memory bus instrumentation.Andy Polyakov
2010-01-24OPENSSL_cleanse to accept zero length parameter [matching C implementation].Andy Polyakov
2009-05-14x86[_64]cpuid.pl: further refine shared cache detection.Andy Polyakov
2009-05-12x86cpuid.pl: sync OPENSSL_ia32_cpuid with x86_64cpuid.pl.Andy Polyakov
2008-01-05Update perl asm scripts include paths for perlasm.Dr. Stephen Henson
2007-07-21x86*cpuid update.Andy Polyakov
2007-05-19x86cpuid fixes.Andy Polyakov
PR: 1526
2007-05-14Profiling revealed that OPENSSL_cleanse consumes *more* CPU time thanAndy Polyakov
sha1_block_data_order when hashing short messages. Move OPENSSL_cleanse to "cpuid" assembler module and gain 2x.
2007-04-01Update x86cpuid.pl to correctly detect shared cache and to support newAndy Polyakov
RC4_set_key.
2005-12-06Support for indirect calls in x86 assembler modules.Andy Polyakov
2005-12-03x86cpuid.pl update.Andy Polyakov
2005-06-24Replace emms with finit in x86cpuid.Andy Polyakov
2005-05-18Don't emit SSE2 instructions unless were asked to.Andy Polyakov
PR: 1073
2005-05-03Cpuid modules updates.Andy Polyakov
2004-09-09x86 assembler updates: more instructions, new OPENSSL_instrument_haltAndy Polyakov
[for DJGPP]...
2004-08-29OPENSSL_ia32cap final touches. Note that OPENSSL_ia32cap is no longer aAndy Polyakov
symbol, but a macro expanded as (*(OPENSSL_ia32cap_loc())). The latter is the only one to be exported to application.
2004-07-26Add framework for yet another assembler module dubbed "cpuid." IdeaAndy Polyakov
is to have a placeholder to small routines, which can be written only in assembler. In IA-32 case this includes processor capability identification and access to Time-Stamp Counter. As discussed earlier OPENSSL_ia32cap is introduced to control recently added SSE2 code pathes (see docs/crypto/OPENSSL_ia32cap.pod). For the moment the code is operational on ELF platforms only. I haven't checked it yet, but I have all reasons to believe that Windows build should fail to link too. I'll be looking into it shortly...