KVM: x86 emulator: drop vcpu argument from intercept callback
authorAvi Kivity <avi@redhat.com>
Wed, 20 Apr 2011 10:37:53 +0000 (13:37 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 22 May 2011 12:39:05 +0000 (08:39 -0400)
Making the emulator caller agnostic.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c

index 2c02e753ab82a94b8141bc54483850cbfa2875ae..e2b082aa32014e5b4077f7fbdae4968df75c111b 100644 (file)
@@ -185,7 +185,7 @@ struct x86_emulate_ops {
        int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
        void (*get_fpu)(struct x86_emulate_ctxt *ctxt); /* disables preempt */
        void (*put_fpu)(struct x86_emulate_ctxt *ctxt); /* reenables preempt */
-       int (*intercept)(struct kvm_vcpu *vcpu,
+       int (*intercept)(struct x86_emulate_ctxt *ctxt,
                         struct x86_instruction_info *info,
                         enum x86_intercept_stage stage);
 };
index 33ad16b7db2b743b73f253aa9717fc7b14a3d469..acb9fcc283eea0459f73e410668f349a9256a463 100644 (file)
@@ -438,7 +438,7 @@ static int emulator_check_intercept(struct x86_emulate_ctxt *ctxt,
                .next_rip   = ctxt->eip,
        };
 
-       return ctxt->ops->intercept(ctxt->vcpu, &info, stage);
+       return ctxt->ops->intercept(ctxt, &info, stage);
 }
 
 static inline unsigned long ad_mask(struct decode_cache *c)
index 16373a5bfd0138b062e14ece485e64a82e43a717..4f7248ea6cafe60e08da7961c4b6a98ffca6a529 100644 (file)
@@ -4365,11 +4365,11 @@ static void emulator_put_fpu(struct x86_emulate_ctxt *ctxt)
        preempt_enable();
 }
 
-static int emulator_intercept(struct kvm_vcpu *vcpu,
+static int emulator_intercept(struct x86_emulate_ctxt *ctxt,
                              struct x86_instruction_info *info,
                              enum x86_intercept_stage stage)
 {
-       return kvm_x86_ops->check_intercept(vcpu, info, stage);
+       return kvm_x86_ops->check_intercept(emul_to_vcpu(ctxt), info, stage);
 }
 
 static struct x86_emulate_ops emulate_ops = {