diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-28 08:59:33 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-22 08:40:01 -0400 |
commit | 0a434bb2bf094f463ca3ca71ac42cea9e423048f (patch) | |
tree | c37059b8ce8490a607f638a5a61d69fb01ecbc94 /arch/x86/kvm | |
parent | ae8cc059550b2c2ec7a5e9650bb1be7b988a1208 (diff) |
KVM: VMX: Avoid reading %rip unnecessarily when handling exceptions
Avoids a VMREAD.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/vmx.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
3170 | } | 3170 | } |
3171 | 3171 | ||
3172 | error_code = 0; | 3172 | error_code = 0; |
3173 | rip = kvm_rip_read(vcpu); | ||
3174 | if (intr_info & INTR_INFO_DELIVER_CODE_MASK) | 3173 | if (intr_info & INTR_INFO_DELIVER_CODE_MASK) |
3175 | error_code = vmcs_read32(VM_EXIT_INTR_ERROR_CODE); | 3174 | error_code = vmcs_read32(VM_EXIT_INTR_ERROR_CODE); |
3176 | if (is_page_fault(intr_info)) { | 3175 | if (is_page_fault(intr_info)) { |
@@ -3217,6 +3216,7 @@ static int handle_exception(struct kvm_vcpu *vcpu) | |||
3217 | vmx->vcpu.arch.event_exit_inst_len = | 3216 | vmx->vcpu.arch.event_exit_inst_len = |
3218 | vmcs_read32(VM_EXIT_INSTRUCTION_LEN); | 3217 | vmcs_read32(VM_EXIT_INSTRUCTION_LEN); |
3219 | kvm_run->exit_reason = KVM_EXIT_DEBUG; | 3218 | kvm_run->exit_reason = KVM_EXIT_DEBUG; |
3219 | rip = kvm_rip_read(vcpu); | ||
3220 | kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip; | 3220 | kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip; |
3221 | kvm_run->debug.arch.exception = ex_no; | 3221 | kvm_run->debug.arch.exception = ex_no; |
3222 | break; | 3222 | break; |