From: Patrick Steuer Date: Wed, 7 Feb 2018 17:49:29 +0000 (+0100) Subject: s390x assembly pack: implement OPENSSL_rdtsc as STCKF X-Git-Tag: OpenSSL_1_1_1-pre2~162 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19308587d4a4fd2886b0ca193ccfc6756d867cb1;p=oweals%2Fopenssl.git s390x assembly pack: implement OPENSSL_rdtsc as STCKF .. if avalable. STCK has an artificial delay to ensure uniqueness which can result in a performance penalty if used heavily concurrently. Signed-off-by: Patrick Steuer Reviewed-by: Andy Polyakov Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5284) --- diff --git a/crypto/s390xcpuid.pl b/crypto/s390xcpuid.pl index 5f6ffc66d6..b0ed9e0623 100755 --- a/crypto/s390xcpuid.pl +++ b/crypto/s390xcpuid.pl @@ -129,6 +129,14 @@ OPENSSL_s390x_facilities: .type OPENSSL_rdtsc,\@function .align 16 OPENSSL_rdtsc: + larl %r4,OPENSSL_s390xcap_P + tm S390X_STFLE+3(%r4),0x40 # check for store-clock-fast facility + jz .Lstck + + .long 0xb27cf010 # stckf 16($sp) + lg %r2,16($sp) + br $ra +.Lstck: stck 16($sp) lg %r2,16($sp) br $ra