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>
This commit is contained in:
committed by
Avi Kivity
parent
df4f310856
commit
dc25e89e07
@@ -1527,7 +1527,9 @@ static int pf_interception(struct vcpu_svm *svm)
|
||||
trace_kvm_page_fault(fault_address, error_code);
|
||||
if (!npt_enabled && kvm_event_needs_reinjection(&svm->vcpu))
|
||||
kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address);
|
||||
r = kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code);
|
||||
r = kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code,
|
||||
svm->vmcb->control.insn_bytes,
|
||||
svm->vmcb->control.insn_len);
|
||||
break;
|
||||
case KVM_PV_REASON_PAGE_NOT_PRESENT:
|
||||
svm->apf_reason = 0;
|
||||
|
||||
Reference in New Issue
Block a user