diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-07-10 16:08:15 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 05:42:40 -0400 |
commit | 2a7c5b8b550b1fb1db9eb490420132e637f5dcb4 (patch) | |
tree | 49ee4d514e9af781bec31ff8f07f9d8a5687a6b6 | |
parent | 376c53c2b30d4a1955240f59f4ecd959aa118f92 (diff) |
KVM: x86 emulator: emulate clflush
If the guest issues a clflush in a mmio address, the instruction
can trap into the hypervisor. Currently, we do not decode clflush
properly, causing the guest to hang. This patch fixes this emulating
clflush (opcode 0f ae).
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | arch/x86/kvm/x86_emulate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 8bc63f62fbbd..f2f90468f8b1 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c | |||
@@ -219,7 +219,7 @@ static u16 twobyte_table[256] = { | |||
219 | /* 0xA0 - 0xA7 */ | 219 | /* 0xA0 - 0xA7 */ |
220 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, | 220 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, |
221 | /* 0xA8 - 0xAF */ | 221 | /* 0xA8 - 0xAF */ |
222 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, | 222 | 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, ModRM, 0, |
223 | /* 0xB0 - 0xB7 */ | 223 | /* 0xB0 - 0xB7 */ |
224 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, | 224 | ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, |
225 | DstMem | SrcReg | ModRM | BitOp, | 225 | DstMem | SrcReg | ModRM | BitOp, |
@@ -1947,6 +1947,8 @@ twobyte_insn: | |||
1947 | c->src.val &= (c->dst.bytes << 3) - 1; | 1947 | c->src.val &= (c->dst.bytes << 3) - 1; |
1948 | emulate_2op_SrcV_nobyte("bts", c->src, c->dst, ctxt->eflags); | 1948 | emulate_2op_SrcV_nobyte("bts", c->src, c->dst, ctxt->eflags); |
1949 | break; | 1949 | break; |
1950 | case 0xae: /* clflush */ | ||
1951 | break; | ||
1950 | case 0xb0 ... 0xb1: /* cmpxchg */ | 1952 | case 0xb0 ... 0xb1: /* cmpxchg */ |
1951 | /* | 1953 | /* |
1952 | * Save real source value, then compare EAX against | 1954 | * Save real source value, then compare EAX against |