components/openssl/openssl-1.0.1-fips-140/patches/38_remove_illegal_instruction_calls.patch
author jenny.yung@oracle.com <jenny.yung@oracle.com>
Mon, 25 Aug 2014 14:20:21 -0700
branchs11u2-sru
changeset 3285 78460de60ed1
child 4006 c737cefdce54
permissions -rw-r--r--
17799549 libcrypto openssl incorrect size for libcrypto.so.1.0.0`_sparcv9_random

#
# This patch was developed in-house.
# This is Solaris-specific: not suitable for upstream.
#
--- openssl-1.0.1h/crypto/sparcv9cap.c.~1~	Mon Aug  4 15:18:42 2014
+++ openssl-1.0.1h/crypto/sparcv9cap.c	Mon Aug  4 15:30:21 2014
@@ -5,6 +5,7 @@
 #include <signal.h>
 #include <sys/time.h>
 #include <openssl/bn.h>
+#include <sys/auxv.h>
 
 #define SPARCV9_TICK_PRIVILEGED	(1<<0)
 #define SPARCV9_PREFER_FPU	(1<<1)
@@ -31,7 +32,6 @@
 void		_sparcv9_vis1_probe(void);
 unsigned long	_sparcv9_vis1_instrument(void);
 void		_sparcv9_vis2_probe(void);
-void		_sparcv9_fmadd_probe(void);
 
 unsigned long OPENSSL_rdtsc(void)
 	{
@@ -171,6 +171,7 @@
 	struct sigaction	common_act,ill_oact,bus_oact;
 	sigset_t		all_masked,oset;
 	static int trigger=0;
+	uint_t ui = 0;
 
 	if (trigger) return;
 	trigger=1;
@@ -183,6 +184,7 @@
 
 	/* Initial value, fits UltraSPARC-I&II... */
 	OPENSSL_sparcv9cap_P = SPARCV9_PREFER_FPU|SPARCV9_TICK_PRIVILEGED;
+	(void) getisax(&ui, 1);
 
 	sigfillset(&all_masked);
 	sigdelset(&all_masked,SIGILL);
@@ -222,11 +224,8 @@
 			}
 		}
 
-	if (sigsetjmp(common_jmp,1) == 0)
-		{
-		_sparcv9_fmadd_probe();
+	if (ui & AV_SPARC_FMAF)
 		OPENSSL_sparcv9cap_P |= SPARCV9_FMADD;
-		}
 
 	sigaction(SIGBUS,&bus_oact,NULL);
 	sigaction(SIGILL,&ill_oact,NULL);
--- openssl-1.0.1h/crypto/sparccpuid.S.~1~	Mon Aug  4 15:18:57 2014
+++ openssl-1.0.1h/crypto/sparccpuid.S	Mon Aug  4 15:30:34 2014
@@ -304,16 +304,6 @@
 .type	_sparcv9_vis2_probe,#function
 .size	_sparcv9_vis2_probe,.-_sparcv9_vis2_probe
 
-.global	_sparcv9_fmadd_probe
-.align	8
-_sparcv9_fmadd_probe:
-	.word	0x81b00d80	!fxor	%f0,%f0,%f0
-	.word	0x85b08d82	!fxor	%f2,%f2,%f2
-	retl
-	.word	0x81b80440	!fmaddd	%f0,%f0,%f2,%f0
-.type	_sparcv9_fmadd_probe,#function
-.size	_sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe
-
 .global	OPENSSL_cleanse
 .align	32
 OPENSSL_cleanse: