From: Avi Kivity Date: Thu, 28 Apr 2011 12:59:33 +0000 (+0300) Subject: KVM: VMX: Avoid reading %rip unnecessarily when handling exceptions X-Git-Tag: MMI-PSA29.97-13-9~19664^2~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0a434bb2bf094f463ca3ca71ac42cea9e423048f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git KVM: VMX: Avoid reading %rip unnecessarily when handling exceptions Avoids a VMREAD. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3f6e9bff0160..139a5cb1f5e1 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3170,7 +3170,6 @@ static int handle_exception(struct kvm_vcpu *vcpu) } error_code = 0; - rip = kvm_rip_read(vcpu); if (intr_info & INTR_INFO_DELIVER_CODE_MASK) error_code = vmcs_read32(VM_EXIT_INTR_ERROR_CODE); if (is_page_fault(intr_info)) { @@ -3217,6 +3216,7 @@ static int handle_exception(struct kvm_vcpu *vcpu) vmx->vcpu.arch.event_exit_inst_len = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); kvm_run->exit_reason = KVM_EXIT_DEBUG; + rip = kvm_rip_read(vcpu); kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip; kvm_run->debug.arch.exception = ex_no; break;