diff options
author | Laurent Vivier <Laurent.Vivier@bull.net> | 2007-09-18 05:27:37 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:47 -0500 |
commit | 3427318fd2244737a466a06a93c5fe579852f871 (patch) | |
tree | 7c6760dbbdd067498c470e6e4f711e5baeef491c /drivers/kvm/kvm.h | |
parent | 1be3aa47182e94944e57b176a5c4ee4e74f1ce33 (diff) |
KVM: Call x86_decode_insn() only when needed
Move emulate_ctxt to kvm_vcpu to keep emulate context when we exit from kvm
module. Call x86_decode_insn() only when needed. Modify x86_emulate_insn() to
not modify the context if it must be re-entered.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index da9c3aa1c08c..e885b190b798 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -207,6 +207,8 @@ enum { | |||
207 | VCPU_SREG_LDTR, | 207 | VCPU_SREG_LDTR, |
208 | }; | 208 | }; |
209 | 209 | ||
210 | #include "x86_emulate.h" | ||
211 | |||
210 | struct kvm_pio_request { | 212 | struct kvm_pio_request { |
211 | unsigned long count; | 213 | unsigned long count; |
212 | int cur_count; | 214 | int cur_count; |
@@ -380,6 +382,10 @@ struct kvm_vcpu { | |||
380 | 382 | ||
381 | int cpuid_nent; | 383 | int cpuid_nent; |
382 | struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES]; | 384 | struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES]; |
385 | |||
386 | /* emulate context */ | ||
387 | |||
388 | struct x86_emulate_ctxt emulate_ctxt; | ||
383 | }; | 389 | }; |
384 | 390 | ||
385 | struct kvm_mem_alias { | 391 | struct kvm_mem_alias { |
@@ -555,7 +561,7 @@ enum emulation_result { | |||
555 | }; | 561 | }; |
556 | 562 | ||
557 | int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run, | 563 | int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run, |
558 | unsigned long cr2, u16 error_code); | 564 | unsigned long cr2, u16 error_code, int no_decode); |
559 | void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context); | 565 | void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context); |
560 | void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); | 566 | void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); |
561 | void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); | 567 | void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); |