From: Avi Kivity Subject: [PATCH 1/4] KVM: Fix x86_decode_insn() return code check Date: Tue, 4 Jan 2011 15:14:41 +0200 Message-ID: <1294146884-6253-2-git-send-email-avi@redhat.com> References: <1294146884-6253-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14421 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236Ab1ADNPA (ORCPT ); Tue, 4 Jan 2011 08:15:00 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p04DF0kV032525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Jan 2011 08:15:00 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p04DExhj013507 for ; Tue, 4 Jan 2011 08:14:59 -0500 In-Reply-To: <1294146884-6253-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: x86_decode_insn() doesn't return X86EMUL_* values, it returns EMULATION_* codes. Adjust the check. Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index fa708c9..b20499d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4391,7 +4391,7 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, vcpu->arch.emulate_ctxt.perm_ok = false; r = x86_decode_insn(&vcpu->arch.emulate_ctxt, insn, insn_len); - if (r == X86EMUL_PROPAGATE_FAULT) + if (r != EMULATION_OK) goto done; trace_kvm_emulate_insn_start(vcpu); -- 1.7.1