Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Kinsella, Ray" <ray.kinsella@intel.com>
To: "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: [meta-oe][PATCH] openssl: remove lock data_word from x86cpuid.pl
Date: Thu, 17 Sep 2015 15:03:28 +0000	[thread overview]
Message-ID: <1442502208.12473.4.camel@intel.com> (raw)

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


             reply	other threads:[~2015-09-17 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 15:03 Kinsella, Ray [this message]
2015-09-18  9:22 ` [meta-oe][PATCH] openssl: remove lock data_word from x86cpuid.pl Jussi Kukkonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442502208.12473.4.camel@intel.com \
    --to=ray.kinsella@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox