Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1967856ybl; Thu, 29 Aug 2019 01:25:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEOsNUALFXFZgsOy8/KB9qmTueeHM15l15FOvZZ6UVBHrSZFdZqTE7wOAdxMUdZ6oNP191 X-Received: by 2002:a17:902:bc47:: with SMTP id t7mr8451961plz.329.1567067149058; Thu, 29 Aug 2019 01:25:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567067149; cv=pass; d=google.com; s=arc-20160816; b=NEmHCQoqxpVKPWe2ZptVOkgrL/EdZYQXVoCQV2fOlDyC/7fPYR46HLnealkCyDG4u7 bUm+rUGeF0O234lwe+dl/x1AW1D4GapO5mz4N5B3b0xDZcA3SG8583ro3l9/a63M/xh1 d3RaHA84WTzoJCUgQXSCfFs8zosvEIhwLlhioy6kncLbZQt+EuVSUEJVKRVMMcyecTN4 QlD/RGYTydcZK5shlP6YiHBmrpmL0x7HnNAcRCkkCE4wfy2uDV6U1s/Y9jnap9nviSUA oj41RGn1szINIwTGF1K2tpdmjGwcgpodcPdKa3J+WBoXDHcMndaSPN1PLERG1uhYjaAN MQwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=5LuyGNhNrlfcnZvv+W7xKG+CckyJ2SriczrGAChgeKw=; b=JYKNaoLjyHocPHc21aZCYZnUKAUXlPqbTPn8+oiWWYTQdpVJyfMCksIBbXOkQRVsDw sc7sF2EL1enILPJuW2silJgs8LOb73lgwaUywJ9zRMmaM+3NA+tJcKR6dtirJW2Vl4fR R8aNzSOsPdRDvJBk1pL3ofYkFE4gippW2nbl2ySPx+SAL1Xwge6TTauMhUW6sotPLfRG a48kJccKj0fQn0DiSXUN9V9gU0a+cnZlNMcvD0uGJn0+t4ZoOE4io+/OHNU9MB5ZuZj3 XdSk/7zyn7MYYs/214chNHE9JBoqHiuELz0Oq24uf2UkCWsdYrVHnoir1tiV5NDGVl8+ DPwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=uWEfBo6B; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si1564030pjy.34.2019.08.29.01.25.33; Thu, 29 Aug 2019 01:25:49 -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; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=uWEfBo6B; arc=pass (i=1 spf=pass spfdomain=virtuozzo.com dkim=pass dkdomain=virtuozzo.com dmarc=pass fromdomain=virtuozzo.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=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbfH2IX2 (ORCPT + 99 others); Thu, 29 Aug 2019 04:23:28 -0400 Received: from mail-eopbgr10099.outbound.protection.outlook.com ([40.107.1.99]:44097 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726936AbfH2IXZ (ORCPT ); Thu, 29 Aug 2019 04:23:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Akrlbb6mXDETd8mkeP98MguamKuvljwAzuAaQkAJBXY7AfmOKdyDR7AyRMUoB1alpzFtXQ7FH84Uz60q1KObremhUVd1UHSZ7HmcJcOar68H2fGpytV28Yl8pEEVA+xxzT3W49dekLsCYK2dyZ5hLRTVIHYmkVdTiVQ4nrVe26Q8Z8AyMDaTQOkqSK5rW4ltaChkhA5XiaZMkXwoHA1ffQt4OfzLFq1RLX+LGfVyTUhCQ/MMPpFdyrQ1K/h7k/6vP0OiKSqG5X2J3kbW/u71XmZzFTD89nGj2tCYP37NLN36Yyde2P5fI5E0CoIaSrUhqwUhZ9kziL6HN+ROXYt0rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5LuyGNhNrlfcnZvv+W7xKG+CckyJ2SriczrGAChgeKw=; b=XOA9WqYG/R8MdVj5yz7/eDSAuikzxjK+/MLf8gx4pFxlG6TsJK9f45ORxlgvY5cImQ+Gpir88Y8fWZdyCnzOvuF6hU/MGQ8LamK+mtPIF8Z69CrRbR8h3coqv+mek5v/CrR9rAbc5KFEIzIoc6sg3x8WMP4Pf+9JcWDsdjr64I4u5kEeFgoHmO3xqs0neQggyaB2LuDh4//cZlWABwN2Jr/bXqZJHlgt7/NLHC/DYUX2qUyo2bp/m0PSVDZDV1/x5zjgJON2BBN8BOpLf3PYPIbQsgAE2ixRJpIH9eS4UxHtmjK7DAvSVNH2HeX3fxXUiSUuUdFplBF44RlMzvNjzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5LuyGNhNrlfcnZvv+W7xKG+CckyJ2SriczrGAChgeKw=; b=uWEfBo6Bhp9XzFzTljWeQO/BiaFxjloRp3OVrTwnUYLvLK2yM7XK/MeWb6U7Uo3OQy8ffg8jCd7Wb3iUAraTiHm1ObmViylLDdge+rr/L4O0NjqnUwcwmtjs5FspBSTSsAG5EvNoVL+I1ODFVWP9qZK1FgcwJKV83kCgH9zPxxw= Received: from VI1PR08MB2782.eurprd08.prod.outlook.com (10.170.236.143) by VI1PR08MB3342.eurprd08.prod.outlook.com (52.134.31.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2220.18; Thu, 29 Aug 2019 08:23:21 +0000 Received: from VI1PR08MB2782.eurprd08.prod.outlook.com ([fe80::2969:e370:fb70:71a]) by VI1PR08MB2782.eurprd08.prod.outlook.com ([fe80::2969:e370:fb70:71a%3]) with mapi id 15.20.2178.023; Thu, 29 Aug 2019 08:23:21 +0000 From: Jan Dakinevich To: "linux-kernel@vger.kernel.org" CC: Jan Dakinevich , Denis Lunev , Roman Kagan , Denis Plotnikov , Paolo Bonzini , =?iso-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Sean Christopherson , 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: [PATCH v3 2/2] KVM: x86: set ctxt->have_exception in x86_decode_insn() Thread-Topic: [PATCH v3 2/2] KVM: x86: set ctxt->have_exception in x86_decode_insn() Thread-Index: AQHVXkMEmSTghXkdTUiK1kvyvFq3Lw== Date: Thu, 29 Aug 2019 08:23:20 +0000 Message-ID: <1567066988-23376-3-git-send-email-jan.dakinevich@virtuozzo.com> References: <1567066988-23376-1-git-send-email-jan.dakinevich@virtuozzo.com> In-Reply-To: <1567066988-23376-1-git-send-email-jan.dakinevich@virtuozzo.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR05CA0274.eurprd05.prod.outlook.com (2603:10a6:3:fc::26) To VI1PR08MB2782.eurprd08.prod.outlook.com (2603:10a6:802:19::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jan.dakinevich@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.1.4 x-originating-ip: [185.231.240.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3c3e0883-dd29-4984-570e-08d72c5a26c9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600166)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:VI1PR08MB3342; x-ms-traffictypediagnostic: VI1PR08MB3342: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2733; x-forefront-prvs: 0144B30E41 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(346002)(39850400004)(396003)(366004)(376002)(199004)(189003)(66476007)(66946007)(66556008)(50226002)(64756008)(66446008)(4744005)(2351001)(2501003)(36756003)(14454004)(8936002)(86362001)(66066001)(81156014)(81166006)(6436002)(5640700003)(6512007)(71200400001)(71190400001)(44832011)(486006)(476003)(6916009)(5660300002)(52116002)(54906003)(14444005)(53936002)(102836004)(99286004)(2906002)(6486002)(478600001)(8676002)(6506007)(386003)(446003)(11346002)(2616005)(26005)(76176011)(186003)(7416002)(305945005)(4326008)(3846002)(25786009)(7736002)(256004)(6116002)(316002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB3342;H:VI1PR08MB2782.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: q3DiaVp4hWiULxowV1pDgjxeXSfK9WEW8wBzGVdas1Mo/ZO2HsqaqFpzsoH9kuwYLF95wjBrpftI/729FlWavKbFzGd1fqrJTy8QV7YiWMOBmop7AVMW/r9ii8GbmPFjPBmnhZQGYFxWwpVKX1mQkzoYmnzCYoglPa0hcHZ14nvQH61Ngv0/Wq7mSK8wUC5aaqGe+N9EPKVI5eSNwrDQrdfmyRkQ9XccEGLsvInQNhxveCYPaSiXimOsBCXvJzM3/WDuNZl6lq2uGUTVgZ19WNmGrX+Tc9H901oXUXZVpFr3VCZgHfxfoooJfb6/pMSV4KR0P8gIZrILyG6eJcrkkZ/ZMlDqiDCkHXadICEJOkquc19Un7yrYS8myoElY1qqSKvgpHt10nKZ9fTqQkyjd6uN23fBZyE6aHHr7egJWPY= Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c3e0883-dd29-4984-570e-08d72c5a26c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2019 08:23:20.9720 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fIqdJ/wOOewmNj1Iix3FSzGuVpEbFiDhUfkdEy9G7wmONvqLnDzk+NcTNXFC4nW3fJd/zVUORy+yanKdhdNrdmFH/lnCJ6O9IhJGyiJvAAo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3342 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, vo= id *insn, int insn_len) ctxt->memopp->addr.mem.ea + ctxt->_eip); =20 done: + if (rc =3D=3D X86EMUL_PROPAGATE_FAULT) + ctxt->have_exception =3D true; return (rc !=3D X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK; } =20 --=20 2.1.4