From: Takuya Yoshikawa <[email protected]>

This stops "CMP r/m, reg" to write back the data into memory.
Pointed out by Avi.

Signed-off-by: Takuya Yoshikawa <[email protected]>
---
 arch/x86/kvm/emulate.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 14c5ad5..8a73805 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3084,6 +3084,7 @@ special_insn:
                emulate_2op_SrcV("xor", c->src, c->dst, ctxt->eflags);
                break;
        case 0x38 ... 0x3d:
+               c->dst.type = OP_NONE; /* Disable writeback. */
              cmp:              /* cmp */
                emulate_2op_SrcV("cmp", c->src, c->dst, ctxt->eflags);
                break;
@@ -3138,6 +3139,7 @@ special_insn:
                case 6:
                        goto xor;
                case 7:
+                       c->dst.type = OP_NONE; /* Disable writeback. */
                        goto cmp;
                }
                break;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to