aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/perlasm
Commit message (Collapse)AuthorAgeFilesLines
* Fix many MarkDown issues in {NOTES*,README*,HACKING,LICENSE}.md filesDr. David von Oheimb2020-07-051-82/+88
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12109)
* Rename NOTES*, README*, VERSION, HACKING, LICENSE to .md or .txtDr. David von Oheimb2020-07-051-0/+0
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12109)
* Remove whitespace from 'white space'haykam8212020-06-193-3/+3
| | | | | | | | CLA: trivial Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12161)
* Update copyright yearMatt Caswell2020-05-151-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11839)
* Amend references to "OpenSSL license"Shourya Shukla2020-04-292-2/+2
| | | | | | | | | | | | A small number of files contain references to the "OpenSSL license" which has been deprecated and replaced by the "Apache License 2.0". Amend the occurences. Fixes #11649 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11663)
* Update copyright yearMatt Caswell2020-04-235-5/+5
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
* Fix build with clang assemblerPhilippe Antoine2020-03-031-0/+5
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11219)
* crypto/perlasm/x86_64-xlate.pl: detect GNU as to deal with quirksRichard Levitte2020-03-021-1/+13
| | | | | | | | | | | It turns out that GNU as and Solaris as don't have compatible ideas on the .section syntax, so we need to check if we're using GNU as or another assembler and adapt this .section syntax accordingly. Fixes #11132 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11191)
* x86_64: Replace .asciz "GNU" with .byteH.J. Lu2020-02-261-1/+6
| | | | | | | | | | Replace .asciz "GNU" with .byte since .asciz isn't supported on Solaris. Fixes https://github.com/openssl/openssl/issues/11132 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11137)
* x86_64: Don't assume 8-byte pointer sizeH.J. Lu2020-02-181-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | Since pointer in x32 is 4 bytes, add x86_64-support.pl to define pointer_size and pointer_register based on flavour to support stuctures like: struct { void *ptr; int blocks; } This fixes 90-test_sslapi.t on x32. Verified with $ ./Configure shared linux-x86_64 $ make $ make test and $ ./Configure shared linux-x32 $ make $ make test Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10988)
* Also check for errors in x86_64-xlate.pl.David Benjamin2020-02-173-3/+3
| | | | | | | | | | | | | | 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)
* x86_64: Always generate .note.gnu.property section for ELF outputsH.J. Lu2020-02-131-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We should always generate .note.gnu.property section in x86_64 assembly codes for ELF outputs to mark Intel CET support since all input files must be marked with Intel CET support in order for linker to mark output with Intel CET support. Also .note.gnu.property section in x32 should be aligned to 4 bytes, not 8 bytes and .p2align should be used consistently. Verified with $ CC="gcc -Wl,-z,cet-report=error" ./Configure shared linux-x86_64 -fcf-protection $ make $ make test and $ CC="gcc -mx32 -Wl,-z,cet-report=error" ./Configure shared linux-x32 -fcf-protection $ make $ make test # <<< 90-test_sslapi.t failed because 8-byte pointer size. Fix #10896 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10985)
* x86: Always generate .note.gnu.property section for ELF outputsH.J. Lu2020-02-081-0/+20
| | | | | | | | | | | | | | | | | We should always generate .note.gnu.property section in x86 assembly codes for ELF outputs to mark Intel CET support since all input files must be marked with Intel CET support in order for linker to mark output with Intel CET support. Verified with $ CC="gcc -Wl,-z,cet-report=error" ./Configure shared linux-x86 -fcf-protection $ make $ make test Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11044)
* Fix misspelling errors and typos reported by codespellDr. Matthias St. Pierre2020-02-061-1/+1
| | | | | | | Fixes #10998 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11000)
* x86: Add endbranch to indirect branch targets for Intel CETH.J. Lu2020-02-052-0/+8
| | | | | | | | | | | | | | To support Intel CET, all indirect branch targets must start with endbranch. Here is a patch to add endbranch to all function entries in x86 assembly codes which are indirect branch targets as discovered by running openssl testsuite on Intel CET machine and visual inspection. Since x86 cbc.pl uses indirect branch with a jump table, we also need to add endbranch to all jump targets. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10984)
* Do not silently truncate files on perlasm errorsDavid Benjamin2020-01-222-2/+2
| | | | | | | | | | | | | | | 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)
* Add GNU properties note for Intel CET in x86_64-xlate.plRichard Levitte2020-01-181-0/+21
| | | | | | | | | | | | | This appears to be emitted with gcc and clang with -fcf-protection selected, so we should do the same. We're trying to be smart, and only emit this when the 'endbranch' pseudo-mnemonic has been used at least once. This is inspired by and owes to work done by @hjl-tools (github) Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/10875)
* crypto/perlasm/ppc-xlate.pl: add linux64v2 flavourAndy Polyakov2019-12-111-4/+4
| | | | | | | | | | | This is a big endian ELFv2 configuration. ELFv2 was already being used for little endian, and big endian was traditionally ELFv1 but there are practical configurations that use ELFv2 with big endian nowadays (Adélie Linux, Void Linux, possibly Gentoo, etc.) Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8883)
* s390x assembly pack: perlasm module updatePatrick Steuer2019-11-051-37/+70
| | | | | | | | | | | - add instructions: clfi, stck, stckf, kdsa - clfi and clgfi belong to extended-immediate (not long-displacement) - some cleanup Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10346)
* s390x assembly pack: enable clang buildPatrick Steuer2019-11-031-1/+1
| | | | | | | | | | clang imposes some restrictions on the assembler code that gcc does not. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10330)
* s390x assembly pack: update perlasm modulePatrick Steuer2019-04-251-2/+84
| | | | | | | | | | | Add non-base instructions which are used by the chacha20 and poly1305 modules. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8181)
* s390x assembly pack: allow alignment hints for vector load/storePatrick Steuer2019-04-251-4/+4
| | | | | | | | | | | | z14 introduced alignment hints to help vector load/store performance. For its predecessors, alignment hint defaults to 0 (no alignment indicated). Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8181)
* Check for unpaired .cfi_remember_stateDavid Benjamin2019-02-171-1/+7
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #8109
* Fix some CFI issues in x86_64 assemblyDavid Benjamin2019-02-171-0/+9
| | | | | | | | | | | | | | | | | | | | The add/double shortcut in ecp_nistz256-x86_64.pl left one instruction point that did not unwind, and the "slow" path in AES_cbc_encrypt was not annotated correctly. For the latter, add .cfi_{remember,restore}_state support to perlasm. Next, fill in a bunch of functions that are missing no-op .cfi_startproc and .cfi_endproc blocks. libunwind cannot unwind those stack frames otherwise. Finally, work around a bug in libunwind by not encoding rflags. (rflags isn't a callee-saved register, so there's not much need to annotate it anyway.) These were found as part of ABI testing work in BoringSSL. Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #8109
* ARM64 assembly pack: make it Windows-friendly.Andy Polyakov2019-02-161-0/+10
| | | | | | | | | | | "Windows friendliness" means a) unified PIC-ification, unified across all platforms; b) unified commantary delimiter; c) explicit ldur/stur, as Visual Studio assembler can't automatically encode ldr/str as ldur/stur when needed. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8256)
* ARM assembly pack: make it Windows-friendly.Andy Polyakov2019-02-161-0/+7
| | | | | | | | | | | | | | | "Windows friendliness" means a) flipping .thumb and .text directives, b) always generate Thumb-2 code when asked(*); c) Windows-specific references to external OPENSSL_armcap_P. (*) so far *some* modules were compiled as .code 32 even if Thumb-2 was targeted. It works at hardware level because processor can alternate between the modes with no overhead. But clang --target=arm-windows's builtin assembler just refuses to compile .code 32... Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8252)
* perlasm/ppc-xlate.pl: add VSX word load/store instructions.Andy Polyakov2019-02-011-0/+2
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8120)
* s390x assembly pack: perlasm support.Patrick Steuer2019-01-051-0/+3060
| | | | | | | | | | | | | Added crypto/perlasm/s390x.pm Perl module. Its primary use is to be independent of binutils version, that is to write byte codes of instructions that are not part of the base instruction set. Currently only gas format is supported. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6919)
* Following the license change, modify the boilerplates in crypto/perlasm/Richard Levitte2018-12-069-9/+9
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7807)
* Update copyright yearMatt Caswell2018-09-111-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7176)
* perlasm/x86_64-xlate.pl: refine symbol recognition in .xdata.Andy Polyakov2018-07-031-1/+1
| | | | | | | Hexadecimals were erroneously recognized as symbols in .xdata. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6626)
* perlasm/ppc-xlate.pl: add vmrg[eo]w instructions.Andy Polyakov2018-06-061-0/+2
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6419)
* perlasm/ppc-xlate.pl: add new instructions and clean up.Andy Polyakov2018-05-301-13/+30
| | | | | | Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6363)
* Copyright update of more files that have changed this yearRichard Levitte2018-01-191-1/+1
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/5110)
* Update copyright years on all files merged since Jan 1st 2018Richard Levitte2018-01-091-1/+1
| | | | | Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5038)
* Remove remaining NETWARE ifdef'sRich Salz2018-01-072-7/+2
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5028)
* Many spelling fixes/typo's corrected.Josh Soref2017-11-111-3/+3
| | | | | | | | | 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)
* perlasm/ppc-xlate.pl: add PowerISA 3.0B instructions.Andy Polyakov2017-06-131-2/+28
| | | | | | [As well as few extra instructions from earlier spec.] Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove filename argument to x86 asm_init.David Benjamin2017-05-114-9/+6
| | | | | | | | | | | | | | | 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)
* perlasm/x86_64-xlate.pl: work around problem with hex constants in masm.Andy Polyakov2017-05-051-2/+3
| | | | | | | | | Perl, multiple versions, for some reason occasionally takes issue with letter b[?] in ox([0-9a-f]+) regex. As result some constants, such as 0xb1 came out wrong when generating code for MASM. Fixes GH#3241. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3385)
* Fix a few typosFdaSilvaYY2017-02-142-5/+5
| | | | | | | [skip ci] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2571)
* perlasm/x86_64-xlate.pl: recognize even offset(%reg) in cfa_expression.Andy Polyakov2017-02-131-0/+2
| | | | | | This is handy when "offset(%reg)" is a perl variable. Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: fix pair of typo-bugs in the new cfi_directive.Andy Polyakov2017-02-101-2/+2
| | | | | | .cfi_{start|end}proc and .cfi_def_cfa were not tracked. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2585)
* perlasm/x86_64-xlate.pl: typo fix in comment.Adam Langley2017-02-101-1/+1
| | | | | | | | CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2584)
* perlasm/x86_64-xlate.pl: recognize DWARF CFI directives.Andy Polyakov2017-02-091-0/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | CFI directives annotate instructions that are significant for stack unwinding procedure. In addition to directives recognized by GNU assembler this module implements three synthetic ones: - .cfi_push annotates push instructions in prologue and translates to .cfi_adjust_cfa_offset (if needed) and .cfi_offset; - .cfi_pop annotates pop instructions in epilogue and translates to .cfi_adjust_cfs_offset (if needed) and .cfi_restore; - .cfi_cfa_expression encodes DW_CFA_def_cfa_expression and passes it to .cfi_escape as byte vector; CFA expression syntax is made up mix of DWARF operator suffixes [subset of] and references to registers with optional bias. Following example describes offloaded original stack pointer at specific offset from current stack pointer: .cfi_cfa_expression %rsp+40,deref,+8 Final +8 has everything to do with the fact that CFA, Canonical Frame Address, is reference to top of caller's stack, and on x86_64 call to subroutine pushes 8-byte return address. Triggered by request from Adam Langley. Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: remove obsolete .picmeup synthetic directive.Andy Polyakov2017-02-091-24/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: minor readability updates.Andy Polyakov2017-02-091-37/+52
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: clarify SEH coding guidelines.Andy Polyakov2017-02-061-12/+17
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: add support for AVX512 OPMASK-ing.Andy Polyakov2016-12-151-13/+23
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* perlasm/x86_64-xlate.pl: refine sign extension in ea package.Andy Polyakov2016-12-121-2/+9
| | | | | | | | | | | $1<<32>>32 worked fine with either 32- or 64-bit perl for a good while, relying on quirk that [pure] 32-bit perl performed it as $1<<0>>0. But this apparently changed in some version past minimally required 5.10, and operation result became 0. Yet, it went unnoticed for another while, because most perl package providers configure their packages with -Duse64bitint option. Reviewed-by: Rich Salz <rsalz@openssl.org>