aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-04-20 06:37:53 -0400
committerAvi Kivity <avi@redhat.com>2011-05-22 08:39:05 -0400
commit2953538ebbd95b145bd3629126fe5af61b88be11 (patch)
tree2f9e85f7c628c6aecbb88134a725c599de820dba /arch
parent717746e382e58f075642403eaac26bce0640b2c5 (diff)
KVM: x86 emulator: drop vcpu argument from intercept callback
Making the emulator caller agnostic. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h2
-rw-r--r--arch/x86/kvm/emulate.c2
-rw-r--r--arch/x86/kvm/x86.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 2c02e753ab82..e2b082aa3201 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -185,7 +185,7 @@ struct x86_emulate_ops {
185 int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata); 185 int (*get_msr)(struct x86_emulate_ctxt *ctxt, u32 msr_index, u64 *pdata);
186 void (*get_fpu)(struct x86_emulate_ctxt *ctxt); /* disables preempt */ 186 void (*get_fpu)(struct x86_emulate_ctxt *ctxt); /* disables preempt */
187 void (*put_fpu)(struct x86_emulate_ctxt *ctxt); /* reenables preempt */ 187 void (*put_fpu)(struct x86_emulate_ctxt *ctxt); /* reenables preempt */
188 int (*intercept)(struct kvm_vcpu *vcpu, 188 int (*intercept)(struct x86_emulate_ctxt *ctxt,
189 struct x86_instruction_info *info, 189 struct x86_instruction_info *info,
190 enum x86_intercept_stage stage); 190 enum x86_intercept_stage stage);
191}; 191};
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 33ad16b7db2b..acb9fcc283ee 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -438,7 +438,7 @@ static int emulator_check_intercept(struct x86_emulate_ctxt *ctxt,
438 .next_rip = ctxt->eip, 438 .next_rip = ctxt->eip,
439 }; 439 };
440 440
441 return ctxt->ops->intercept(ctxt->vcpu, &info, stage); 441 return ctxt->ops->intercept(ctxt, &info, stage);
442} 442}
443 443
444static inline unsigned long ad_mask(struct decode_cache *c) 444static inline unsigned long ad_mask(struct decode_cache *c)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 16373a5bfd01..4f7248ea6caf 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4365,11 +4365,11 @@ static void emulator_put_fpu(struct x86_emulate_ctxt *ctxt)
4365 preempt_enable(); 4365 preempt_enable();
4366} 4366}
4367 4367
4368static int emulator_intercept(struct kvm_vcpu *vcpu, 4368static int emulator_intercept(struct x86_emulate_ctxt *ctxt,
4369 struct x86_instruction_info *info, 4369 struct x86_instruction_info *info,
4370 enum x86_intercept_stage stage) 4370 enum x86_intercept_stage stage)
4371{ 4371{
4372 return kvm_x86_ops->check_intercept(vcpu, info, stage); 4372 return kvm_x86_ops->check_intercept(emul_to_vcpu(ctxt), info, stage);
4373} 4373}
4374 4374
4375static struct x86_emulate_ops emulate_ops = { 4375static struct x86_emulate_ops emulate_ops = {