It's going to get more complicated soon.

Signed-off-by: Avi Kivity <[email protected]>
---
 arch/x86/kvm/emulate.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 7a1cc3c..95291fc 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2451,6 +2451,15 @@ static int em_movdqu(struct x86_emulate_ctxt *ctxt)
        return X86EMUL_CONTINUE;
 }
 
+static int em_invlpg(struct x86_emulate_ctxt *ctxt)
+{
+       struct decode_cache *c = &ctxt->decode;
+       emulate_invlpg(ctxt->vcpu, linear(ctxt, c->src.addr.mem));
+       /* Disable writeback. */
+       c->dst.type = OP_NONE;
+       return X86EMUL_CONTINUE;
+}
+
 #define D(_y) { .flags = (_y) }
 #define N    D(0)
 #define G(_f, _g) { .flags = ((_f) | Group), .u.group = (_g) }
@@ -3658,10 +3667,7 @@ twobyte_insn:
                        rc = X86EMUL_PROPAGATE_FAULT;
                        goto done;
                case 7: /* invlpg*/
-                       emulate_invlpg(ctxt->vcpu,
-                                      linear(ctxt, c->src.addr.mem));
-                       /* Disable writeback. */
-                       c->dst.type = OP_NONE;
+                       rc = em_invlpg(ctxt);
                        break;
                default:
                        goto cannot_emulate;
-- 
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