summaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorLaurent Vivier <Laurent.Vivier@bull.net>2007-09-18 11:27:37 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:52:47 +0200
commit3427318fd2244737a466a06a93c5fe579852f871 (patch)
tree7c6760dbbdd067498c470e6e4f711e5baeef491c /drivers/kvm/kvm.h
parent1be3aa47182e94944e57b176a5c4ee4e74f1ce33 (diff)
downloadlwn-3427318fd2244737a466a06a93c5fe579852f871.tar.gz
lwn-3427318fd2244737a466a06a93c5fe579852f871.zip
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.h8
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 {
VCPU_SREG_LDTR,
};
+#include "x86_emulate.h"
+
struct kvm_pio_request {
unsigned long count;
int cur_count;
@@ -380,6 +382,10 @@ struct kvm_vcpu {
int cpuid_nent;
struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES];
+
+ /* emulate context */
+
+ struct x86_emulate_ctxt emulate_ctxt;
};
struct kvm_mem_alias {
@@ -555,7 +561,7 @@ enum emulation_result {
};
int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run,
- unsigned long cr2, u16 error_code);
+ unsigned long cr2, u16 error_code, int no_decode);
void kvm_report_emulation_failure(struct kvm_vcpu *cvpu, const char *context);
void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);