From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Martin Simmons <martin@lispworks.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 5/6] target-i386: Make x86 mfence and lfence illegal without SSE2
Date: Wed, 8 Jun 2011 09:24:47 +0100 [thread overview]
Message-ID: <1307521488-6066-6-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1307521488-6066-1-git-send-email-stefanha@linux.vnet.ibm.com>
From: Martin Simmons <martin@lispworks.com>
While trying to use qemu -cpu pentium3 to test for incorrect uses of certain
SSE2 instructions, I found that QEMU allowed the mfence and lfence
instructions to be executed even though Pentium 3 doesn't support them.
According to the processor specs (and experience on a real Pentium 3), these
instructions are only available with SSE2, but QEMU is checking for SSE. The
check for the related sfence instruction is correct (it works with SSE).
This trival patch fixes the test.
Signed-off-by: Martin Simmons <martin@lispworks.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
target-i386/translate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 199302e..10bd72a 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -7538,7 +7538,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
break;
case 5: /* lfence */
case 6: /* mfence */
- if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE))
+ if ((modrm & 0xc7) != 0xc0 || !(s->cpuid_features & CPUID_SSE2))
goto illegal_op;
break;
case 7: /* sfence / clflush */
--
1.7.4.4
next prev parent reply other threads:[~2011-06-08 8:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 8:24 [Qemu-devel] [PULL 0/6] Trivial patches for May 30 to June 8 2011 Stefan Hajnoczi
2011-06-08 8:24 ` [Qemu-devel] [PATCH 1/6] Fix compilation warning due to missing header for sigaction Stefan Hajnoczi
2011-06-08 8:24 ` [Qemu-devel] [PATCH 2/6] Fix compilation warning due to missing header for sigaction (followup) Stefan Hajnoczi
2011-06-08 8:24 ` [Qemu-devel] [PATCH 3/6] slirp: fix guestfwd id Stefan Hajnoczi
2011-06-08 8:24 ` [Qemu-devel] [PATCH 4/6] m68k: Replace gen_im32() by tcg_const_i32() Stefan Hajnoczi
2011-06-08 8:24 ` Stefan Hajnoczi [this message]
2011-06-08 8:24 ` [Qemu-devel] [PATCH 6/6] virtio: Move virtio-pci to hw library Stefan Hajnoczi
2011-06-09 12:39 ` [Qemu-devel] [PULL 0/6] Trivial patches for May 30 to June 8 2011 Anthony Liguori
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=1307521488-6066-6-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=martin@lispworks.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).