From: Glauber Costa <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4f98888..3698922 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2032,11 +2032,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",
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to