Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25be4608 authored by Glauber Costa's avatar Glauber Costa Committed by Avi Kivity
Browse files

KVM: Do not calculate linear rip in emulation failure report



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: default avatarGlauber Costa <gcosta@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
parent 622395a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -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 = vcpu->arch.rip;
	unsigned long rip_linear;
	unsigned long rip_linear;


	rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS);

	if (reported)
	if (reported)
		return;
		return;


	rip_linear = rip + get_segment_base(vcpu, VCPU_SREG_CS);

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


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