aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@amd.com>2010-12-21 05:12:07 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:31:07 -0500
commitdc25e89e07d5ef31c476117d2c76b34dbb22196c (patch)
tree9fef452c4bd0704b9d74512a9a58dc5d5b742d53 /arch/x86/include/asm/kvm_host.h
parentdf4f3108562dc6f6ae6648f2698df7f4c9acf52d (diff)
KVM: SVM: copy instruction bytes from VMCB
In case of a nested page fault or an intercepted #PF newer SVM implementations provide a copy of the faulting instruction bytes in the VMCB. Use these bytes to feed the instruction emulator and avoid the costly guest instruction fetch in this case. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/kvm_host.h')
-rw-r--r--arch/x86/include/asm/kvm_host.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index de00b6026b76..6268f6ce6434 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -634,13 +634,13 @@ enum emulation_result {
634#define EMULTYPE_NO_DECODE (1 << 0) 634#define EMULTYPE_NO_DECODE (1 << 0)
635#define EMULTYPE_TRAP_UD (1 << 1) 635#define EMULTYPE_TRAP_UD (1 << 1)
636#define EMULTYPE_SKIP (1 << 2) 636#define EMULTYPE_SKIP (1 << 2)
637int x86_emulate_instruction(struct kvm_vcpu *vcpu, 637int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2,
638 unsigned long cr2, int emulation_type); 638 int emulation_type, void *insn, int insn_len);
639 639
640static inline int emulate_instruction(struct kvm_vcpu *vcpu, 640static inline int emulate_instruction(struct kvm_vcpu *vcpu,
641 int emulation_type) 641 int emulation_type)
642{ 642{
643 return x86_emulate_instruction(vcpu, 0, emulation_type); 643 return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
644} 644}
645 645
646void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); 646void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address);
@@ -721,7 +721,8 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
721 721
722int kvm_fix_hypercall(struct kvm_vcpu *vcpu); 722int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
723 723
724int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); 724int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code,
725 void *insn, int insn_len);
725void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva); 726void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva);
726 727
727void kvm_enable_tdp(void); 728void kvm_enable_tdp(void);