[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/6] target-i386: Make x86 mfence and lfence illegal
From: |
Stefan Hajnoczi |
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 |
From: Martin Simmons <address@hidden>
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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
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
- [Qemu-devel] [PULL 0/6] Trivial patches for May 30 to June 8 2011, Stefan Hajnoczi, 2011/06/08
- [Qemu-devel] [PATCH 1/6] Fix compilation warning due to missing header for sigaction, Stefan Hajnoczi, 2011/06/08
- [Qemu-devel] [PATCH 6/6] virtio: Move virtio-pci to hw library, Stefan Hajnoczi, 2011/06/08
- [Qemu-devel] [PATCH 4/6] m68k: Replace gen_im32() by tcg_const_i32(), Stefan Hajnoczi, 2011/06/08
- [Qemu-devel] [PATCH 5/6] target-i386: Make x86 mfence and lfence illegal without SSE2,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 3/6] slirp: fix guestfwd id, Stefan Hajnoczi, 2011/06/08
- [Qemu-devel] [PATCH 2/6] Fix compilation warning due to missing header for sigaction (followup), Stefan Hajnoczi, 2011/06/08
- Re: [Qemu-devel] [PULL 0/6] Trivial patches for May 30 to June 8 2011, Anthony Liguori, 2011/06/09