Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5570492ybl; Tue, 27 Aug 2019 06:43:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWCVkNVXGNfe3T0PO5bKl1S/3CWakkJtvWFvhwitCCE3i7OejrfBlGt7Hh9WyxJ9BDTnLK X-Received: by 2002:aa7:8c04:: with SMTP id c4mr2313884pfd.59.1566913391629; Tue, 27 Aug 2019 06:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566913391; cv=none; d=google.com; s=arc-20160816; b=EYwKCae8qCL1xj1cn1F/X9mGhlUzHhGWMOCqKM7uZBQYkfHPBE4X+8PQSK/dfL+sO3 p3dtd/ojbzAB9ndK7OzbmKITm7wFIeZrh802U8bd+70fOCxjapDnyhPm9fS1AAtHTrxh S1qR1AWoxfxzm9Tn7d8PR8pgqH68/I/dVHDNL8EcmnwuN2UFcV/6wJNmxIjXfLetL/DS ytqt2dqRf23sKo3vRLg/fiVBKiyvdh4HVjPgovpv+ffOpPBjAw9IiydNJwOfKEs+3ZtW Q5ZC2eos9Uvq0xFO9WZqwwOV9ugOjcJKYb14X9lMcHHwmnWXL5qbEs+Ed9pVIgEfj3+g 5Jaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nJKTPfnYQuWmndN5zuo4aDY2l0ExrI0muNIxWYcXnLc=; b=icuJqN8f9a/YayzwtIAFyPvVOUveqimbHeaB28K77GSY/h1oSp8HmGJXQ1h9rrOFR7 QafWi8GN1SZ8hzjyLDdzuJDAzx7bb/1BN8viEr3LDUfiWz+JlJgi2SWzZQsaijYxDbPl ZQGFXLDcaLr+72PUWZvCYBkc/lC+9TfDfJ8kzXc5hraaYAeJnF0zUxqQZRNEQgWHIL1z VD9pjg9AygdOvB4Ah22LGHljSSRAOq4cAk8MP+W3GZvD1rBT86tsR9mlrHoR6JltMQOo rpeFCIko2brMxXSqFWxlsoT81jJ7YkyRnoSitHZgKXidfR+B2BeudQ2IN33kbRkIlL11 DYUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si11782456pgr.196.2019.08.27.06.42.56; Tue, 27 Aug 2019 06:43:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728802AbfH0NmE (ORCPT + 99 others); Tue, 27 Aug 2019 09:42:04 -0400 Received: from mga06.intel.com ([134.134.136.31]:18721 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbfH0NmD (ORCPT ); Tue, 27 Aug 2019 09:42:03 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 06:42:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,437,1559545200"; d="scan'208";a="171199517" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by orsmga007.jf.intel.com with ESMTP; 27 Aug 2019 06:42:02 -0700 Date: Tue, 27 Aug 2019 06:42:02 -0700 From: Sean Christopherson To: Jan Dakinevich Cc: "linux-kernel@vger.kernel.org" , Denis Lunev , Roman Kagan , Denis Plotnikov , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "x86@kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH 1/3] KVM: x86: fix wrong return code Message-ID: <20190827134202.GB27459@linux.intel.com> References: <1566911210-30059-1-git-send-email-jan.dakinevich@virtuozzo.com> <1566911210-30059-2-git-send-email-jan.dakinevich@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566911210-30059-2-git-send-email-jan.dakinevich@virtuozzo.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 01:07:04PM +0000, Jan Dakinevich wrote: > x86_emulate_instruction(), the caller of x86_decode_insn(), expects > that x86_decode_insn()'s returning value belongs to EMULATION_* name > space. However, this function may return value from X86EMUL_* name > space. > > Although, the code behaves properly (because both X86EMUL_CONTINUE and > EMULATION_OK are equal to 0) this change makes code more consistent and > it is required for further fixes. > > Cc: Denis Lunev > Cc: Roman Kagan > Cc: Denis Plotnikov > Signed-off-by: Jan Dakinevich > --- > arch/x86/kvm/emulate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index 718f7d9..6170ddf 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -5144,7 +5144,7 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) > else { > rc = __do_insn_fetch_bytes(ctxt, 1); > if (rc != X86EMUL_CONTINUE) > - return rc; > + goto done; Funny how things go unnoticed for years and then suddenly... https://lkml.kernel.org/r/9bf79098-703c-e82b-7e7d-1c0a6a1023c2@redhat.com > } > > switch (mode) { > -- > 2.1.4 >