diff options
author | Avi Kivity <avi@redhat.com> | 2011-03-31 18:48:09 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 13:57:06 +0200 |
commit | 38503911b32186240301bbe81601cfabb37e752e (patch) | |
tree | da0bd5f6304209ad94d667a9ddce9e1596c5fa73 /arch/x86/kvm/emulate.c | |
parent | KVM: x86 emulator: Add helpers for memory access using segmented addresses (diff) | |
download | linux-38503911b32186240301bbe81601cfabb37e752e.tar.xz linux-38503911b32186240301bbe81601cfabb37e752e.zip |
KVM: x86 emulator: move invlpg emulation into a function
It's going to get more complicated soon.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | 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 8c38f6ca935b..c522b4e3dbb0 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; |