Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp37731ybl; Thu, 29 Aug 2019 18:10:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqjTkdU9gP4q/hYOLpHY33FjzmYo80FCcL9lnz713/wnMbQrGR09AZQjTUo7qcNewHtLZf X-Received: by 2002:a17:902:8a87:: with SMTP id p7mr13027852plo.240.1567127453618; Thu, 29 Aug 2019 18:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567127453; cv=none; d=google.com; s=arc-20160816; b=IDOgDN8fznUx6i96v+WiUIS9l842Y8jG4Yk9ZFAb3at5PjPKUzwr3wATl0kzgo1OQT GAXK8KQg4/NvZ1LVdjCFtE5YuXFC5N2qdK4c1xQYkK2awq93elSBLfPPhsRylsARDO8y XaEHBLoaS8bJsNb0qHT3n1FqkmgkUR4KWb9o9iLJzM9Ypb02Yv34Nh9d8axsTHutweOD nLw18R03WQ4crqza0CWDzXdKsfb1VwtwmXgbuYM+/ybaLPWDT55TBDjwzrSSG1Dc7FyN AjdfoLVP+DvOfng6rrOR5o3Iz5VY2LBPqPJlHf+G4Ads3Qbi4cG24nT/CVCCdkqG4gOE z5KQ== 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=QTLB9OKRaG+QtNsG4RkudYxL/Kw5bkbhUjnNZFiiPH8=; b=rsyjLWYKEa0egcq1zbo+XoCcYzEPaLcVoRQMKbNSWJuu1t8rSsHd+LgtUfhJfYOyOJ 3jBSnvI1yqRg6V/eXmucUjrbnbccSWPGk4JEh2wHoTF8TlRgLWV8qNdX2alCR96ZFDkQ 71catS70YhChNaRbED1ye/3F6QzgceqXuCi1serZjMPscq5lUtGTW5HpMEbULySVDa/B KHBYYboL2ue5+JiYApZjGFbnVcr6CcV//aNfM8mhp/b+3432Y/pe6fk3I0esEGtgG7Td gddnVt50ODpxWMAugUriztNnBrS8kF+kSqGzpHQ07QJvRcT9684E0fe2S2RJfv6q+zmO WpFQ== 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 e23si3233515pgv.528.2019.08.29.18.10.37; Thu, 29 Aug 2019 18:10:53 -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 S1727632AbfH3BIl (ORCPT + 99 others); Thu, 29 Aug 2019 21:08:41 -0400 Received: from mga12.intel.com ([192.55.52.136]:29749 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726991AbfH3BIk (ORCPT ); Thu, 29 Aug 2019 21:08:40 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 18:08:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,445,1559545200"; d="scan'208";a="186148955" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by orsmga006.jf.intel.com with ESMTP; 29 Aug 2019 18:08:40 -0700 Date: Thu, 29 Aug 2019 18:08:40 -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 v3 2/2] KVM: x86: set ctxt->have_exception in x86_decode_insn() Message-ID: <20190830010840.GD27970@linux.intel.com> References: <1567066988-23376-1-git-send-email-jan.dakinevich@virtuozzo.com> <1567066988-23376-3-git-send-email-jan.dakinevich@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1567066988-23376-3-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 Thu, Aug 29, 2019 at 08:23:20AM +0000, Jan Dakinevich wrote: > x86_emulate_instruction() takes into account ctxt->have_exception flag > during instruction decoding, but in practice this flag is never set in > x86_decode_insn(). > > Fixes: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") > Cc: Denis Lunev > Cc: Roman Kagan > Cc: Denis Plotnikov > Signed-off-by: Jan Dakinevich Same nits as last patch: Cc: Fixes: 6ea6e84309ca ("KVM: x86: inject exceptions produced by x86_decode_insn") Reviewed-and-tested-by: Sean Christopherson > --- > arch/x86/kvm/emulate.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index bef3c3c..698efb8 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -5416,6 +5416,8 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, void *insn, int insn_len) > ctxt->memopp->addr.mem.ea + ctxt->_eip); > > done: > + if (rc == X86EMUL_PROPAGATE_FAULT) > + ctxt->have_exception = true; > return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK; > } > > -- > 2.1.4 >