[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/46] target/i386: Fix decoding of certain BMI instructions
From: |
Paolo Bonzini |
Subject: |
[PULL 17/46] target/i386: Fix decoding of certain BMI instructions |
Date: |
Mon, 8 Feb 2021 19:23:02 +0100 |
From: David Greenaway <dgreenaway@google.com>
This patch fixes a translation bug for a subset of x86 BMI instructions
such as the following:
c4 e2 f9 f7 c0 shlxq %rax, %rax, %rax
Currently, these incorrectly generate an undefined instruction exception
when SSE is disabled via CR4, while instructions like "shrxq" work fine.
The problem appears to be related to BMI instructions encoded using VEX
and with a mandatory prefix of "0x66" (data). Instructions with this
data prefix (such as shlxq) are currently rejected. Instructions with
other mandatory prefixes (such as shrxq) translate as expected.
This patch removes the incorrect check in "gen_sse" that causes the
exception to be generated. For the non-BMI cases, the check is
redundant: prefixes are already checked at line 3696.
Buglink: https://bugs.launchpad.net/qemu/+bug/1748296
Signed-off-by: David Greenaway <dgreenaway@google.com>
Message-Id: <20210114063958.1508050-1-dgreenaway@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 6a4c31f933..af1faf9342 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -3075,7 +3075,7 @@ static void gen_sse(CPUX86State *env, DisasContext *s,
int b,
}
if (is_xmm
&& !(s->flags & HF_OSFXSR_MASK)
- && ((b != 0x38 && b != 0x3a) || (s->prefix & PREFIX_DATA))) {
+ && (b != 0x38 && b != 0x3a)) {
goto unknown_op;
}
if (b == 0x0e) {
--
2.29.2
- [PULL 07/46] fuzz: add virtio-9p configurations for fuzzing, (continued)
- [PULL 07/46] fuzz: add virtio-9p configurations for fuzzing, Paolo Bonzini, 2021/02/08
- [PULL 01/46] fuzz: ignore address_space_map is_write flag, Paolo Bonzini, 2021/02/08
- [PULL 13/46] fuzz: fix wrong index in clear_bits, Paolo Bonzini, 2021/02/08
- [PULL 09/46] machine: add missing doc for memory-backend option, Paolo Bonzini, 2021/02/08
- [PULL 14/46] docs: don't install corresponding man page if guest agent is disabled, Paolo Bonzini, 2021/02/08
- [PULL 11/46] meson: honor --enable-rbd if cc.links test fails, Paolo Bonzini, 2021/02/08
- [PULL 16/46] event_notifier: handle initialization failure better, Paolo Bonzini, 2021/02/08
- [PULL 10/46] meson: accept either shared or static libraries if --disable-static, Paolo Bonzini, 2021/02/08
- [PULL 12/46] x86/cpu: Populate SVM CPUID feature bits, Paolo Bonzini, 2021/02/08
- [PULL 15/46] virtio-scsi: don't uninitialize queues that we didn't initialize, Paolo Bonzini, 2021/02/08
- [PULL 17/46] target/i386: Fix decoding of certain BMI instructions,
Paolo Bonzini <=
- [PULL 20/46] meson: Explicit TCG backend used, Paolo Bonzini, 2021/02/08
- [PULL 18/46] target/i86: implement PKS, Paolo Bonzini, 2021/02/08
- [PULL 19/46] configure: Improve TCI feature description, Paolo Bonzini, 2021/02/08
- [PULL 21/46] meson: Warn when TCI is selected but TCG backend is available, Paolo Bonzini, 2021/02/08
- [PULL 22/46] tests/meson: Only build softfloat objects if TCG is selected, Paolo Bonzini, 2021/02/08
- [PULL 23/46] pc-bios/meson: Only install EDK2 blob firmwares with system emulation, Paolo Bonzini, 2021/02/08
- [PULL 24/46] meson: Restrict block subsystem processing, Paolo Bonzini, 2021/02/08
- [PULL 29/46] qapi/meson: Remove QMP from user-mode emulation, Paolo Bonzini, 2021/02/08
- [PULL 27/46] meson: Restrict emulation code, Paolo Bonzini, 2021/02/08
- [PULL 28/46] qapi/meson: Restrict qdev code to system-mode emulation, Paolo Bonzini, 2021/02/08