summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-04-20 15:47:13 +0300
committerAvi Kivity <avi@redhat.com>2011-05-22 08:39:18 -0400
commitd6aa10003b0cded5a538af0d198460e89dc2d6d2 (patch)
tree1a98dd6a65d5c9deaa83616b3a74fdcff5ca00fd /arch/x86/kvm
parent6c3287f7c5050076b554145f11bdba058de287d1 (diff)
downloadtalos-obmc-linux-d6aa10003b0cded5a538af0d198460e89dc2d6d2.tar.gz
talos-obmc-linux-d6aa10003b0cded5a538af0d198460e89dc2d6d2.zip
KVM: x86 emulator: add ->fix_hypercall() callback
Artificial, but needed to remove direct calls to KVM. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/emulate.c4
-rw-r--r--arch/x86/kvm/x86.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 210df51b76a4..64e7373d3b2b 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4025,7 +4025,7 @@ twobyte_insn:
if (c->modrm_mod != 3 || c->modrm_rm != 1)
goto cannot_emulate;
- rc = kvm_fix_hypercall(ctxt->vcpu);
+ rc = ctxt->ops->fix_hypercall(ctxt);
if (rc != X86EMUL_CONTINUE)
goto done;
@@ -4048,7 +4048,7 @@ twobyte_insn:
if (c->modrm_mod == 3) {
switch (c->modrm_rm) {
case 1:
- rc = kvm_fix_hypercall(ctxt->vcpu);
+ rc = ctxt->ops->fix_hypercall(ctxt);
break;
default:
goto cannot_emulate;
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2246cf1a4ee0..4a2b40e25021 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -152,6 +152,8 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
u64 __read_mostly host_xcr0;
+int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt);
+
static inline void kvm_async_pf_hash_reset(struct kvm_vcpu *vcpu)
{
int i;
@@ -4406,6 +4408,7 @@ static struct x86_emulate_ops emulate_ops = {
.set_msr = emulator_set_msr,
.get_msr = emulator_get_msr,
.halt = emulator_halt,
+ .fix_hypercall = emulator_fix_hypercall,
.get_fpu = emulator_get_fpu,
.put_fpu = emulator_put_fpu,
.intercept = emulator_intercept,
@@ -5042,8 +5045,9 @@ out:
}
EXPORT_SYMBOL_GPL(kvm_emulate_hypercall);
-int kvm_fix_hypercall(struct kvm_vcpu *vcpu)
+int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt)
{
+ struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
char instruction[3];
unsigned long rip = kvm_rip_read(vcpu);
OpenPOWER on IntegriCloud