Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5527733ybl; Tue, 27 Aug 2019 06:08:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyP3iyuaKiBpvfFPzaNcHzPs73ylpFdzlfEqQzTxQ8hZ4bu/ApdmjSwhmeRlj3sevI0NbSW X-Received: by 2002:a17:90a:148:: with SMTP id z8mr24985610pje.96.1566911327381; Tue, 27 Aug 2019 06:08:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566911327; cv=pass; d=google.com; s=arc-20160816; b=aa5fYTVh+yhAx6cbSllPQKHMVjZ0C1cySuLme+g2SiGxyyVQJCKsQtmDdXouun76UC L5CNigeB8+lfML7rAO25sZrKjj82irfysprOCV1zzNeOTRQB61CUb/4X5Kg3/i6T/y5T rutbsj1/PF4Ce6H6x+HgmzlCa7ap308mOflNwInnpWYsdQG5+pJlnuLrzsw6fyBo1YJc 5TZIjhXfT6rZxsJRXjZO4UU2DJwXwrw8t/fz/Xw7bbBZR7BC/SbPjZkTZK87/pXV4T1t fZhHBcTuSVaEcvclxRL+v3pJcVWPi4qlJHTdEs7SXluAUSlk88vYoh4/Pg+sOdqAK3t6 1CAw== 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=svMO617yxV9WjSTdFYoLpdoZVKjKefsZQpgPhyC5Fp4=; b=RXY/DuhcklqNWWWciCkA0ebswT+p3CRiss7aBqrjaL1USkaQbEN6hbz+tuMkzlwJ3M MXMaRMDSLSXjUupG8Gi5K77ySQlyOmNufm6etUxdPodH0wBh2P7oVkXmNzMLP68j8jAq crv5ii2kRKSSNOkmti3qb0uBfmYLiBcWHeHOOpa33xtPM/e1pZ0OhHDFqxSNV340jfkR 89f35EgW1myM2yAtYpJEK7xSU2QQaX4wk25kfvJYAmwCKXQOpRxmNd1IzfhfN5M0TOGR jO3plEUhnmFxALLK4befTamzrVzhhFgM1GG+v/7oINeFwUgnLsoUdnxYaozelmIJns1Q 6FJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b="Ubt7/bPO"; 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 y7si10513366plp.328.2019.08.27.06.08.31; Tue, 27 Aug 2019 06:08:47 -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="Ubt7/bPO"; 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 S1729860AbfH0NHJ (ORCPT + 99 others); Tue, 27 Aug 2019 09:07:09 -0400 Received: from mail-eopbgr30119.outbound.protection.outlook.com ([40.107.3.119]:35904 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726170AbfH0NHG (ORCPT ); Tue, 27 Aug 2019 09:07:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E9gtfSZk9QPeRHJrMrgZ4WFRMOUEvOSqGikHLrOQ4zR+atZB6TCIFN5nvFMMGj0+s+1zULE48HLM4nsM6SzWojHq6cR3sDe6jC9fZFUHVTKaMalfsiUWiXjaGLlUu6jEWkxCVwBNqrp6RjHOr+wN3EAwMlB+VawW/UIP909f7gf2QprsJFb7DIrn18835JvN7ypqUZWJC57pYrBLfKGZY9F2Yd1FqUsPBF1AbXGcG2iHoyiZ4PgooUUmBlYJsUWnz8pqvlSa0KRGAi8xmf/SlVXGVr3Cz2TvD+KSITWB4zW10nTSQ5kUxI7Rr47o7bSageNvE8ghzg0QkizpDBkc2A== 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=svMO617yxV9WjSTdFYoLpdoZVKjKefsZQpgPhyC5Fp4=; b=MpudOCttzB2+S2WFE9mHf+5/c+xn85Z5vgNzRlvNaq+lSfqHJX4ZhfiWftdUOnUoiMeQ+2xtOMVjQnR6m+b1Ao4ACvqae/FbuBSXSmoP3JZBHj8n3mZjaWaFwd45lXv5mCwILkvucDuNV+x7SB0ZS2Gbpvjyau6rQ9D98aEZFbCCFCn4mMXSVjBGboYpzVQReBu6DCL0klhqYBpypS5+wfz2s7tz6bdSoTGXir3mO3MUjwv906Xm2F48tKjFI3bmqBIrudjfb/XqgLgmNcqix3lCSKljcnPF2BT3bG4f2Q4aC7UGE0EpDGzne9GsZLR7VaAYSGXRivWA51H3mAefMg== 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=svMO617yxV9WjSTdFYoLpdoZVKjKefsZQpgPhyC5Fp4=; b=Ubt7/bPO+Xm038/qVDR8KdiZpA3fzuP4i3EbBtXLCO8qfVcV1sEdWkkF7IGi8qO/RTqpIx3nX3lVLVisr0yEFgxy/ZHyTq3Qp2HJtHnCjm51TJRY2MVMo5huLLJugnAADV0qNIOYXeBcd5+HdEwjyGW9K3tCp/4/8nOtespXBo4= Received: from VI1PR08MB2782.eurprd08.prod.outlook.com (10.170.236.143) by VI1PR08MB3471.eurprd08.prod.outlook.com (20.177.59.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.21; Tue, 27 Aug 2019 13:07:04 +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; Tue, 27 Aug 2019 13:07:04 +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 1/3] KVM: x86: fix wrong return code Thread-Topic: [PATCH 1/3] KVM: x86: fix wrong return code Thread-Index: AQHVXNhSm57U5w68n0a9k1WFYt6uIw== Date: Tue, 27 Aug 2019 13:07:04 +0000 Message-ID: <1566911210-30059-2-git-send-email-jan.dakinevich@virtuozzo.com> References: <1566911210-30059-1-git-send-email-jan.dakinevich@virtuozzo.com> In-Reply-To: <1566911210-30059-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: HE1PR0802CA0004.eurprd08.prod.outlook.com (2603:10a6:3:bd::14) 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: bb45f6f4-cc33-4b60-90ff-08d72aef74f6 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:VI1PR08MB3471; x-ms-traffictypediagnostic: VI1PR08MB3471: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0142F22657 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39840400004)(396003)(376002)(366004)(346002)(136003)(199004)(189003)(25786009)(54906003)(6436002)(6512007)(5660300002)(64756008)(7736002)(26005)(4744005)(66946007)(36756003)(66446008)(186003)(66556008)(102836004)(7416002)(305945005)(50226002)(2906002)(52116002)(11346002)(486006)(476003)(2616005)(14444005)(6506007)(386003)(44832011)(76176011)(446003)(256004)(66066001)(99286004)(316002)(66476007)(53936002)(14454004)(5640700003)(2501003)(81156014)(6116002)(6486002)(71200400001)(2351001)(81166006)(6916009)(4326008)(86362001)(3846002)(8676002)(71190400001)(478600001)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR08MB3471;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: PMJObK75TD/Un6nmv5QMkeoE11yAPQQOaRm2D3fBt+UtVTclu5GkeoklEerNgqdDmGuv5cQsK+UNirnN1G5Kx8j6nmPd6T3CUtk3AvqItB/wX4xfdWSJf8RdTdxU/Cv347PxRjRCyxervG5xk5KWjQh/pGFXgK95l7JEWxmO+f0BjocQeg1PphaBo6UIKTwQl+/nkDId5qdWsgRrkDFKNHJM23jQmdl74JbUo34nWmMJ1wUrcIW1f6OXW1yJ446ZkfSuZQRomTdN3kxRFQfze26sCD/oYz7xNRdavKHsr1M9RdsKZ5iVeiYFkPtKC9CCPAc/rkvJ/MccWBppJUMqhckdmFhA5aXoC0KwV2f7/Hncs7fp0nTnhkZ1zp/YT8+fd2cwP+Bq849uzoj3zgCiux02XtPWYTQTUjaAZv2riEE= 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: bb45f6f4-cc33-4b60-90ff-08d72aef74f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2019 13:07:04.7828 (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: 1YneTsPm869tBdRtWEp5o2kfweg3PnVCiAupsk0onmZtt9VD0+9lf0gG5Y/pxR7AjSKWYtxHGlzevps5ft+/0dIrHlqlCxRYTvuQUuWVeNU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3471 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, vo= id *insn, int insn_len) else { rc =3D __do_insn_fetch_bytes(ctxt, 1); if (rc !=3D X86EMUL_CONTINUE) - return rc; + goto done; } =20 switch (mode) { --=20 2.1.4