KVM: x86 emulator: introduce NoWrite flag
authorAvi Kivity <avi.kivity@gmail.com>
Fri, 4 Jan 2013 14:18:50 +0000 (16:18 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 9 Jan 2013 19:39:18 +0000 (17:39 -0200)
Instead of disabling writeback via OP_NONE, just specify NoWrite.

Acked-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/emulate.c

index 42c53c8071bee2bd834768e191fdb8d3a42e1f89..fe113fbb373772ac4fd171e50113bc945c4a69ca 100644 (file)
 #define Unaligned   ((u64)1 << 42)  /* Explicitly unaligned (e.g. MOVDQU) */
 #define Avx         ((u64)1 << 43)  /* Advanced Vector Extensions */
 #define Fastop      ((u64)1 << 44)  /* Use opcode::u.fastop */
+#define NoWrite     ((u64)1 << 45)  /* No writeback */
 
 #define X2(x...) x, x
 #define X3(x...) X2(x), x
@@ -1633,6 +1634,9 @@ static int writeback(struct x86_emulate_ctxt *ctxt)
 {
        int rc;
 
+       if (ctxt->d & NoWrite)
+               return X86EMUL_CONTINUE;
+
        switch (ctxt->dst.type) {
        case OP_REG:
                write_register_operand(&ctxt->dst);