From: Avi Kivity Date: Thu, 31 Mar 2011 16:48:09 +0000 (+0200) Subject: KVM: x86 emulator: move invlpg emulation into a function X-Git-Tag: upstream/snapshot3+hdmi~10359^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38503911b32186240301bbe81601cfabb37e752e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git KVM: x86 emulator: move invlpg emulation into a function It's going to get more complicated soon. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 8c38f6c..c522b4e 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2477,6 +2477,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; +} + static bool valid_cr(int nr) { switch (nr) { @@ -3966,10 +3975,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;