Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1300154ybe; Wed, 11 Sep 2019 12:37:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqw33YKCcF1LeWu57g2h6Fbas5rZMabrYd5TKs1qvgjuWymRFSUAbBIvH0p6YQyACBi0s5OD X-Received: by 2002:a17:906:7294:: with SMTP id b20mr6582685ejl.216.1568230676458; Wed, 11 Sep 2019 12:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568230676; cv=none; d=google.com; s=arc-20160816; b=vfwkBM7nYxcC91kjbPxSdHiA9DRL+Qjnic25lFYRIxJUWwXH97AbImPPcq0LHh2VMg pq7hE5FE77+L9TuFkanVYqPNyxDrl1i/f99lZtkK6QZ6Ku7jIRAUhVyVjJiee2oxoS3w HxgcDeNe4HKv+Q7b+zC8e3RHwI841OP2OKWkiOGxajEjnpDgtB/FX0NRVjn0yh54icO9 bAqNaW1B2veuCpIBF3Es+mc+4SvKLU4vQRaNFHmHnYYLKbRaRRaRvwUfT53dn/oF5bR0 fkL9NsRhH0rflwHdGzgInk1Pih/DzD6H/crcgSjOH8B3dEgnQ4hHfhxXPFJg3gB3auHQ /YSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=MYNEXJF4GkgPzBLfLPqtcFS1AbXG16xNG5ruRxPdF1M=; b=uGL/r/mfZcdPWFxcDrmpuCSlnxsfjMb6b3/v9CZLVz77x1XpY5MltWoggRXnkbmdGW 38GjRMXTJjvWYdTEfd66kvEsxUP8QNkYRwrMmX4YRXS5BxY0VGIozttEw5iROT+Uaxqo ysH6PQhsqJXWzHAi6zQj2hTEh+LlyQ4APMG6LFok8Esc1+mpnH4Br/O1vhSGSI73urIK rpv86wWcSCgML6g/Zg5QLoraYDTgn9C/bHrcYsaW7YldqVfA20nbOxUejSHF9vlsdOAT jv1/uUNcwOjNrmPGGeFXHU1QAQ+wq1DWSxJfJVFfAnlbSy2Kqj4b4fPTEheK7srtLMeR olFw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g17si11761138ejw.198.2019.09.11.12.37.18; Wed, 11 Sep 2019 12:37:56 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728746AbfIKPvL (ORCPT + 99 others); Wed, 11 Sep 2019 11:51:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56448 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbfIKPvL (ORCPT ); Wed, 11 Sep 2019 11:51:11 -0400 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1B487E423 for ; Wed, 11 Sep 2019 15:51:10 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id j2so2435967wre.1 for ; Wed, 11 Sep 2019 08:51:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MYNEXJF4GkgPzBLfLPqtcFS1AbXG16xNG5ruRxPdF1M=; b=IHg4k/EoEJOZsL1hJmQblePN3nEMQDHKfcdnW2ariZVVqHrCCttcDzvgcfsJWEdK3N pAPfJef/fWXsbd5yK6NFp11+h/bAz+XENhmcNVoKjI4UXg8shD8LuMkSw09civ7bmbw2 hysMuQhxrjO1aHhH/UNZmWb9czUdWlrHX9n+LfZ4wWxS4k/I/3f9xWQnWf0yOwJ+UU+Q 2IZfQDzgPV4bpJUK5CaM5DM/s18fRJdg3DjD7wVoi1CcxBGrZwx1qcIw8qjD/SZ3+QbI A7/jgwAVD2S3VOZfdEOqFfnPpULsFoustci9ZMWwBBQc/IGiDvjQ+Y1dcEK0QOATsPR/ K8Xg== X-Gm-Message-State: APjAAAVW3sqKlseLZ7tjNdy2waXAyostQuUArYhVEe2Vw55DKaU6+vwn 3+TBE7KgleE35XnOOPEqk4Tg+4iG0jbppY9GNOjsLtcr+6cUQZGkYTUO6KTmfrDJG2TFe9BFLqi h/YiBk0cZKlcOKOWJ9sCKp3Cg X-Received: by 2002:a7b:c761:: with SMTP id x1mr4475055wmk.100.1568217069595; Wed, 11 Sep 2019 08:51:09 -0700 (PDT) X-Received: by 2002:a7b:c761:: with SMTP id x1mr4475030wmk.100.1568217069325; Wed, 11 Sep 2019 08:51:09 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:102b:3795:6714:7df6? ([2001:b07:6468:f312:102b:3795:6714:7df6]) by smtp.gmail.com with ESMTPSA id r65sm4352320wmr.9.2019.09.11.08.51.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Sep 2019 08:51:08 -0700 (PDT) Subject: Re: [PATCH 0/3] fix emulation error on Windows bootup To: Jan Dakinevich , "linux-kernel@vger.kernel.org" Cc: Denis Lunev , Roman Kagan , Denis Plotnikov , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , 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" References: <1566911210-30059-1-git-send-email-jan.dakinevich@virtuozzo.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Wed, 11 Sep 2019 17:51:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1566911210-30059-1-git-send-email-jan.dakinevich@virtuozzo.com> Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/08/19 15:07, Jan Dakinevich wrote: > This series intended to fix (again) a bug that was a subject of the > following change: > > 6ea6e84 ("KVM: x86: inject exceptions produced by x86_decode_insn") > > Suddenly, that fix had a couple mistakes. First, ctxt->have_exception was > not set if fault happened during instruction decoding. Second, returning > value of inject_emulated_instruction was used to make the decision to > reenter guest, but this could happen iff on nested page fault, that is not > 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 > 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(-) > Queued, thanks. I added the WARN_ON_ONCE that Sean suggested. Paolo