From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbdGYNAZ (ORCPT ); Tue, 25 Jul 2017 09:00:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57846 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbdGYNAY (ORCPT ); Tue, 25 Jul 2017 09:00:24 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0867D7F41F Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com Subject: Re: [PATCH v2] KVM: nVMX: Fix losing NMI blocking state To: Wanpeng Li Cc: "linux-kernel@vger.kernel.org" , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li References: <1500979246-104432-1-git-send-email-wanpeng.li@hotmail.com> <67f40465-95de-3523-f6f2-09e980dd40d7@redhat.com> From: Paolo Bonzini Message-ID: Date: Tue, 25 Jul 2017 15:00:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jul 2017 13:00:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/07/2017 13:36, Wanpeng Li wrote: >> - during VMRESUME emulation, prepare_vmcs02 sets bit 3 in the >> interruptibility-state field of vmcs02, but nmi_known_unmasked is >> still true. >> - on the next L2 exit to L0, nmi_known_unmasked is true so >> vmx_recover_nmi_blocking does not do anything. >> >> Can you explain instead what happens if your v1 patch is applied (on top of mine), >> and why it fixes the bug. > > We will set the expected guest interruptibility-state field before the > final step: L0 fixes the shadow page table (NGVA -> HPA), then L0 > resumes the guest w/ the expected guest interruptibility-state. Aha, that makes sense indeed! I was confused between the first page fault (that is reflected to L1) and the second (that is fixed by L0). Thanks! Paolo