Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5527394ybl; Tue, 27 Aug 2019 06:08:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoPHltcADnYBPHNNf1/WQtznMlMkA9u91sFz1R8QKqhYGVz7jsWvlDBgnyvPd+1UCAJSfu X-Received: by 2002:a17:902:b40e:: with SMTP id x14mr5275461plr.289.1566911314540; Tue, 27 Aug 2019 06:08:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566911314; cv=pass; d=google.com; s=arc-20160816; b=NiQU5ZFzKFIAGxoCYmhVIuHH3PSYQLUAkJbV146K7/zg8rFEfBwDfZHPpe8T6dJVDG rjpvByj8BS0A9StYkwy11B+NZDGIhPCpMdP/8sUWGA6br4nkS5c/e8gHw4QobbkJqFob 2GMnjv7Yw7NoGn7gXy8oHwFCz94kUY5dsz49VZdN8PE2WKbUaKLoj36kUfdIa13B48BM zSID4FnaTUh/9d7ZOEd/+RxKrZfjzOdYkFthqkq/p879EIUt/zg3BHqvofu/Lzt4ruii V9Sgn5fOjIz1G3shA+Xk+BzmrIvUCR14F8e6offcPLk+oTXphUsx7cmV/VEuLahXmPml uZrA== 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:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=pzUMO09cKYplP4IdSQB+IMq/dBJWErbTK/AcBdGhAbk=; b=SFXzpAXc9X1l615xeS224zn1OKsIvS2NEJbV7euu8DxNNvjBT1aAIskXz3OGOf6YRc Szx0M8gmym5D3P17pi04HqbJwxU9qSRKC+tujpLohJQMDXNuUdsoUNzKrfDR93BptYtI MDeoPae8KkjsrmfBlMyFu7aVFTyGeAt+kLXaLJIsDpyhvCmj2IHSGRgvy/LOQec5bVig tfHmVWDOFdiz33TbbyA+x6tTe+WRfJzvQQuh9KsjObCsPoTbUF1sKwf84HQxwhrJQf7a pb+WZu6/FtpGij2sxrSDFKjNtC9OM2Cemp3y0HFOCpQ0mRBgXOYCdZUhLXztaoQUvJnI nNZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector2 header.b=BCFXjOq9; 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 n6si12591249pgs.333.2019.08.27.06.08.17; Tue, 27 Aug 2019 06:08:34 -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=BCFXjOq9; 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 S1729367AbfH0NHF (ORCPT + 99 others); Tue, 27 Aug 2019 09:07:05 -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 S1726054AbfH0NHF (ORCPT ); Tue, 27 Aug 2019 09:07:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jaxrAeu/92hH+I9ljpJBFUrFshz4LtBLqPwbWU2I4FuZ590iX+lkyWRSvYm3bC/EKAXpohjOj9YRCpR/BVYouMWbkP5LMRyHxRKrY3VF+2p9m6W0F2nYkqhgJQNjZ4y8PMjov6ECnhl2lfy3Kx2/odBko7Pagye1b/X4ocWvHLevsvdYjhdocbOOGZg47hg9+0q+wH2v5Vqtu8nMzMbkRQuVkfQ77nO0S0HtgG5s+EVXePEMOYgueBxEZzc4BD1OzbFuhNZqCNgnhwSvNwMa6JXhuof0v8dfEQl/2OuC/cnrRmdlzjgoapZPWXN42PIUqA+1cXzkHRiI1h9EWE51Ew== 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=pzUMO09cKYplP4IdSQB+IMq/dBJWErbTK/AcBdGhAbk=; b=bO8hhM5MFhRLDW/Tjfx16UgI1ajckICMfTKv2ZiDISrMQA5TLUt2fZmzLeLnAp0NoaopNHqMHCa53aSNElZr0x0avfp454v4RBy95nXtChW0q2VH+q9KtwQkrb3QkS7mpVtJbgnq5Gt7hD1uVHjx+FVY8g2tqwMa4nDcKPlKGrRNw760u2H9n/klCoqnCAvRoF+PKwQxUgUIpuxg1dO2R6CaQy6Cwmbhmg/cQKY8ieZ7C4v4bXaetq8xh8vXr1lwWyikeL63yvAYV278UHEaV+TZSYTqjq8tWccFmbtMfzia1p9Flr06NjNVayLrJOsroGiS0Yt2+QR9R+CvXsdlcQ== 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=pzUMO09cKYplP4IdSQB+IMq/dBJWErbTK/AcBdGhAbk=; b=BCFXjOq9axO7P/mR1P7gHjwrf7lptRLsu3cnvF5sJsO93M5tKgwpPqCLNYv5MqqV3Icyh7jcO/AX/H8YC87VKogRL6e7XKSTJylfvEXfcOnTGjfIvFS6MLhHltqybI6V5htrM0wvPdtgndCqNxcQloZ9AdyURWiVaSQSP9q+xSM= 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:01 +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:01 +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 0/3] fix emulation error on Windows bootup Thread-Topic: [PATCH 0/3] fix emulation error on Windows bootup Thread-Index: AQHVXNhQlPTN3PT6WEuOH2XmT3iwQg== Date: Tue, 27 Aug 2019 13:07:00 +0000 Message-ID: <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: 04175519-7c1e-494f-f058-08d72aef72d2 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:9508; 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)(486006)(476003)(2616005)(6506007)(386003)(44832011)(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: /qrFORhe4WnyjEpah2+wjJshltj9p7PEf6pqDU38YXXyZoIzyx1eKU38HAv2he9b+0qrsU7HbgRKzNpiVv6g4zKse+nR01oSxcZyjH322nVRsqj85vIBN1U/J3BCTmyFGk1F84l+bTYd4DPTFPySAckBMUmaLvxutENWZ7oXHBPOmEt4xdbTwps7slz5aDlXqP7zzvSgR4uPrXG9PFk6rhKNozz+hyuEVgnBvNsJVXpFCaPH4f5+sZ81H4vFrNvzPJK0vsvg7hcSk8/AonA281j1fNNE3JnHe6e5G3vjEgL9jlLZMzJLm5KTz76ityNBUoOjszhwkzfToq6E6wRpLX8Ep+CNVm+sDjkmxhwDAAOOASPnq+IZPWqR+KshiYZ/XsWRf5RXMpZKadHB7NufV9VVqbJ6keLLzaV4khZ/qq0= 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: 04175519-7c1e-494f-f058-08d72aef72d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2019 13:07:01.0870 (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: LWC8ng8kkDo/0oYWTtxBfjVtTxanGEaQUSXPZm/JI5PAdpvCrGEJrZmLpgPDFAPM15ifux2jQwyqkE3tbEyhBS4tDHzE5cv7VReX354H6Wg= 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 This series intended to fix (again) a bug that was a subject of the=20 following change: 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") Suddenly, that fix had a couple mistakes. First, ctxt->have_exception was=20 not set if fault happened during instruction decoding. Second, returning=20 value of inject_emulated_instruction was used to make the decision to=20 reenter guest, but this could happen iff on nested page fault, that is not= =20 the scope where this bug could occur. However, I have still deep doubts about 3rd commit in the series. Could you please, make me an advise if it is the correct handling of guest page=20 fault? Jan Dakinevich (3): KVM: x86: fix wrong return code KVM: x86: set ctxt->have_exception in x86_decode_insn() KVM: x86: always stop emulation on page fault arch/x86/kvm/emulate.c | 4 +++- arch/x86/kvm/x86.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) --=20 2.1.4