Openembedded Core Discussions
 help / color / mirror / Atom feed
* [meta-oe][PATCH] openssl: remove lock data_word from x86cpuid.pl
@ 2015-09-17 15:03 Kinsella, Ray
  2015-09-18  9:22 ` Jussi Kukkonen
  0 siblings, 1 reply; 2+ messages in thread
From: Kinsella, Ray @ 2015-09-17 15:03 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

The cmpxchg instruction is encoded in functions such as OPENSSL_atomic_add
as a perlasm data_word. This has the effect of hiding the instruction from 
the assembler. Stripping the LOCK prefix on cmpxchg via the assembler with 
--momit-lock-prefix=yes then becomes impossible (required on the Intel X1000). 
This patch converts the data_word into perlasm instructions.

Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
---
 .../openssl/remove-lock-data_word-from-x86cpuid.pl.patch   |   12 ++++++++++++
 meta/recipes-connectivity/openssl/openssl_1.0.2d.bb        |    1 +
 2 files changed, 13 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-lock-data_word-from-x86cpuid.pl.patch

diff --git a/meta/recipes-connectivity/openssl/openssl/remove-lock-data_word-from-x86cpuid.pl.patch b/meta/recipes-connectivity/openssl/openssl/remove-lock-data_word-from-x86cpuid.pl.patch
new file mode 100644
index 0000000..e969e91
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/remove-lock-data_word-from-x86cpuid.pl.patch
@@ -0,0 +1,12 @@
+--- openssl-1.0.2d/crypto/x86cpuid.pl.orig	2015-09-16 21:11:01.927322252 +0100
++++ openssl-1.0.2d/crypto/x86cpuid.pl	2015-09-16 21:14:45.795314992 +0100
+@@ -275,7 +275,8 @@
+ &set_label("spin");
+ 	&lea	("ebx",&DWP(0,"eax","ecx"));
+ 	&nop	();
+-	&data_word(0x1ab10ff0);	# lock;	cmpxchg	%ebx,(%edx)	# %eax is envolved and is always reloaded
++	&lock	();
++	&cmpxchg(&DWP(0,"edx"), "ebx"); # %eax is envolved and is always reloaded
+ 	&jne	(&label("spin"));
+ 	&mov	("eax","ebx");	# OpenSSL expects the new value
+ 	&pop	("ebx");
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb
index 32d8dce..de2ec1a 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb
@@ -33,6 +33,7 @@ SRC_URI += "file://configure-targets.patch \
             file://openssl-fix-des.pod-error.patch \
             file://Makefiles-ptest.patch \
             file://ptest-deps.patch \
+            file://remove-lock-data_word-from-x86cpuid.pl.patch \
             file://run-ptest \
             file://crypto_use_bigint_in_x86-64_perl.patch \
             file://openssl-1.0.2a-x32-asm.patch \
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-18  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 15:03 [meta-oe][PATCH] openssl: remove lock data_word from x86cpuid.pl Kinsella, Ray
2015-09-18  9:22 ` Jussi Kukkonen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox