diff options
author | Andre Przywara <andre.przywara@amd.com> | 2010-12-21 05:12:07 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:31:07 -0500 |
commit | dc25e89e07d5ef31c476117d2c76b34dbb22196c (patch) | |
tree | 9fef452c4bd0704b9d74512a9a58dc5d5b742d53 /arch/x86/kvm/svm.c | |
parent | df4f3108562dc6f6ae6648f2698df7f4c9acf52d (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/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a04c01e324b4..af4b911a8bed 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1527,7 +1527,9 @@ static int pf_interception(struct vcpu_svm *svm) | |||
1527 | trace_kvm_page_fault(fault_address, error_code); | 1527 | trace_kvm_page_fault(fault_address, error_code); |
1528 | if (!npt_enabled && kvm_event_needs_reinjection(&svm->vcpu)) | 1528 | if (!npt_enabled && kvm_event_needs_reinjection(&svm->vcpu)) |
1529 | kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); | 1529 | kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); |
1530 | r = kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code); | 1530 | r = kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code, |
1531 | svm->vmcb->control.insn_bytes, | ||
1532 | svm->vmcb->control.insn_len); | ||
1531 | break; | 1533 | break; |
1532 | case KVM_PV_REASON_PAGE_NOT_PRESENT: | 1534 | case KVM_PV_REASON_PAGE_NOT_PRESENT: |
1533 | svm->apf_reason = 0; | 1535 | svm->apf_reason = 0; |