aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-07-29 08:11:50 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:21 -0400
commit9aabc88fc8687ba3a520e2ec459821d05f72474e (patch)
tree6e57c011a783af6a8a0e2ca92e3f55eb4d2701ae /arch/x86/kvm/emulate.c
parentab85b12b1a7fd125588f9447653a71ec8e1b5024 (diff)
KVM: x86 emulator: store x86_emulate_ops in emulation context
It doesn't ever change, so we don't need to pass it around everywhere. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index d7e3ea4797f1..3689f34a303a 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -943,8 +943,9 @@ done:
943} 943}
944 944
945int 945int
946x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) 946x86_decode_insn(struct x86_emulate_ctxt *ctxt)
947{ 947{
948 struct x86_emulate_ops *ops = ctxt->ops;
948 struct decode_cache *c = &ctxt->decode; 949 struct decode_cache *c = &ctxt->decode;
949 int rc = X86EMUL_CONTINUE; 950 int rc = X86EMUL_CONTINUE;
950 int mode = ctxt->mode; 951 int mode = ctxt->mode;
@@ -2586,10 +2587,10 @@ static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt,
2586} 2587}
2587 2588
2588int emulator_task_switch(struct x86_emulate_ctxt *ctxt, 2589int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
2589 struct x86_emulate_ops *ops,
2590 u16 tss_selector, int reason, 2590 u16 tss_selector, int reason,
2591 bool has_error_code, u32 error_code) 2591 bool has_error_code, u32 error_code)
2592{ 2592{
2593 struct x86_emulate_ops *ops = ctxt->ops;
2593 struct decode_cache *c = &ctxt->decode; 2594 struct decode_cache *c = &ctxt->decode;
2594 int rc; 2595 int rc;
2595 2596
@@ -2619,8 +2620,9 @@ static void string_addr_inc(struct x86_emulate_ctxt *ctxt, unsigned long base,
2619} 2620}
2620 2621
2621int 2622int
2622x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) 2623x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
2623{ 2624{
2625 struct x86_emulate_ops *ops = ctxt->ops;
2624 u64 msr_data; 2626 u64 msr_data;
2625 struct decode_cache *c = &ctxt->decode; 2627 struct decode_cache *c = &ctxt->decode;
2626 int rc = X86EMUL_CONTINUE; 2628 int rc = X86EMUL_CONTINUE;