aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
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/kvm/mmu.c
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/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 01c5a104031f..ea6063d9242e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3330,7 +3330,8 @@ void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
3330 } 3330 }
3331} 3331}
3332 3332
3333int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code) 3333int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code,
3334 void *insn, int insn_len)
3334{ 3335{
3335 int r; 3336 int r;
3336 enum emulation_result er; 3337 enum emulation_result er;
@@ -3348,7 +3349,7 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
3348 if (r) 3349 if (r)
3349 goto out; 3350 goto out;
3350 3351
3351 er = x86_emulate_instruction(vcpu, cr2, 0); 3352 er = x86_emulate_instruction(vcpu, cr2, 0, insn, insn_len);
3352 3353
3353 switch (er) { 3354 switch (er) {
3354 case EMULATE_DONE: 3355 case EMULATE_DONE: