From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] qemu: Add fix for floating point issues on x86-64
Date: Mon, 30 Sep 2013 22:40:20 +0100 [thread overview]
Message-ID: <1380577220.18603.466.camel@ted> (raw)
There was a bug in handling of the mxcsr register since cpu flags
were not getting updated after fxrstor operations. This small tweak
fixes that.
[YOCTO #5248]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/recipes-devtools/qemu/files/fxrstorssefix.patch b/meta/recipes-devtools/qemu/files/fxrstorssefix.patch
new file mode 100644
index 0000000..59ab0f5
--- /dev/null
+++ b/meta/recipes-devtools/qemu/files/fxrstorssefix.patch
@@ -0,0 +1,31 @@
+When we restore the mxcsr resgister with FXRSTOR, we need to update the various SSE
+flag files by calling update_sse_status() else we're using the flags from some other
+process with interesting results.
+
+The code isn't ordered to make this easy hence the function declaration.
+
+Upstream-Status: Pending
+
+RP 2013/9/30
+
+Index: qemu-1.5.0/target-i386/fpu_helper.c
+===================================================================
+--- qemu-1.5.0.orig/target-i386/fpu_helper.c 2013-09-30 18:46:39.283377648 +0000
++++ qemu-1.5.0/target-i386/fpu_helper.c 2013-09-30 18:46:56.895377232 +0000
+@@ -1149,6 +1149,8 @@
+ }
+ }
+
++static void update_sse_status(CPUX86State *env);
++
+ void helper_fxrstor(CPUX86State *env, target_ulong ptr, int data64)
+ {
+ int i, fpus, fptag, nb_xmm_regs;
+@@ -1180,6 +1182,7 @@
+ if (env->cr[4] & CR4_OSFXSR_MASK) {
+ /* XXX: finish it */
+ env->mxcsr = cpu_ldl_data(env, ptr + 0x18);
++ update_sse_status(env);
+ /* cpu_ldl_data(env, ptr + 0x1c); */
+ if (env->hflags & HF_CS64_MASK) {
+ nb_xmm_regs = 16;
diff --git a/meta/recipes-devtools/qemu/qemu_1.5.0.bb b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
index d6dd743..06c2cdb 100644
--- a/meta/recipes-devtools/qemu/qemu_1.5.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_1.5.0.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
SRC_URI += "file://fdt_header.patch \
file://target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch \
file://target-ppc_fix_bit_extraction.patch \
+ file://fxrstorssefix.patch \
"
SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
reply other threads:[~2013-09-30 21:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1380577220.18603.466.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.