aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-08-01 08:10:29 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:37 -0400
commit5a506b125f1c97c846654ebacc913a136284e42b (patch)
treeca4d3e6e95bee914be84e184462adbc621bb3b28
parentb27f38563d956135a5e80aca749b399ac5f3158a (diff)
KVM: x86 emulator: add NoAccess flag for memory instructions that skip access
Use for INVLPG, which accesses the tlb, not memory. Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/emulate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 628fb5de6a42..80efe76c1ab8 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -83,6 +83,7 @@
83#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */ 83#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
84#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ 84#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
85/* Misc flags */ 85/* Misc flags */
86#define NoAccess (1<<23) /* Don't access memory (lea/invlpg/verr etc) */
86#define Op3264 (1<<24) /* Operand is 64b in long mode, 32b otherwise */ 87#define Op3264 (1<<24) /* Operand is 64b in long mode, 32b otherwise */
87#define Undefined (1<<25) /* No Such Instruction */ 88#define Undefined (1<<25) /* No Such Instruction */
88#define Lock (1<<26) /* lock prefix is allowed for the instruction */ 89#define Lock (1<<26) /* lock prefix is allowed for the instruction */
@@ -2067,7 +2068,8 @@ static struct opcode group5[] = {
2067static struct group_dual group7 = { { 2068static struct group_dual group7 = { {
2068 N, N, D(ModRM | SrcMem | Priv), D(ModRM | SrcMem | Priv), 2069 N, N, D(ModRM | SrcMem | Priv), D(ModRM | SrcMem | Priv),
2069 D(SrcNone | ModRM | DstMem | Mov), N, 2070 D(SrcNone | ModRM | DstMem | Mov), N,
2070 D(SrcMem16 | ModRM | Mov | Priv), D(SrcMem | ModRM | ByteOp | Priv), 2071 D(SrcMem16 | ModRM | Mov | Priv),
2072 D(SrcMem | ModRM | ByteOp | Priv | NoAccess),
2071}, { 2073}, {
2072 D(SrcNone | ModRM | Priv), N, N, D(SrcNone | ModRM | Priv), 2074 D(SrcNone | ModRM | Priv), N, N, D(SrcNone | ModRM | Priv),
2073 D(SrcNone | ModRM | DstMem | Mov), N, 2075 D(SrcNone | ModRM | DstMem | Mov), N,
@@ -2456,7 +2458,7 @@ done_prefixes:
2456 c->src.bytes = (c->d & ByteOp) ? 1 : 2458 c->src.bytes = (c->d & ByteOp) ? 1 :
2457 c->op_bytes; 2459 c->op_bytes;
2458 /* Don't fetch the address for invlpg: it could be unmapped. */ 2460 /* Don't fetch the address for invlpg: it could be unmapped. */
2459 if (c->twobyte && c->b == 0x01 && c->modrm_reg == 7) 2461 if (c->d & NoAccess)
2460 break; 2462 break;
2461 srcmem_common: 2463 srcmem_common:
2462 /* 2464 /*