Skip to content

Commit

Permalink
KVM: Do not calculate linear rip in emulation failure report
Browse files Browse the repository at this point in the history
If we're not gonna do anything (case in which failure is already
reported), we do not need to even bother with calculating the linear rip.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Glauber Costa authored and Avi Kivity committed Jul 20, 2008
1 parent 622395a commit 25be460
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -2081,11 +2081,11 @@ void kvm_report_emulation_failure(struct kvm_vcpu *vcpu, const char *context)
unsigned long rip = vcpu->arch.rip;
unsigned long rip_linear;

rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS);

if (reported)
return;

rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS);

emulator_read_std(rip_linear, (void *)opcodes, 4, vcpu);

printk(KERN_ERR "emulation failed (%s) rip %lx %02x %02x %02x %02x\n",
Expand Down

0 comments on commit 25be460

Please sign in to comment.