From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 1/2] kvm: nVMX: don't flush VMCS12 during VMXOFF or VCPU teardown Date: Wed, 2 Aug 2017 22:37:56 +0200 Message-ID: <20170802203755.GE32403@flask> References: <20170801210040.10295-1-dmatlack@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Matlack , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37552 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123AbdHBUh7 (ORCPT ); Wed, 2 Aug 2017 16:37:59 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 2017-08-02 10:18+0200, Paolo Bonzini: > On 01/08/2017 23:00, David Matlack wrote: > > According to the Intel SDM, software cannot rely on the current VMCS to be > > coherent after a VMXOFF or shutdown. So this is a valid way to handle VMCS12 > > flushes. > > > > 24.11.1 Software Use of Virtual-Machine Control Structures > > ... > > If a logical processor leaves VMX operation, any VMCSs active on > > that logical processor may be corrupted (see below). To prevent > > such corruption of a VMCS that may be used either after a return > > to VMX operation or on another logical processor, software should > > execute VMCLEAR for that VMCS before executing the VMXOFF instruction > > or removing power from the processor (e.g., as part of a transition > > to the S3 and S4 power states). > > ... > > > > This fixes a "suspicious rcu_dereference_check() usage!" warning during > > kvm_vm_release() because nested_release_vmcs12() calls > > kvm_vcpu_write_guest_page() without holding kvm->srcu. > > > > Signed-off-by: David Matlack > > --- > > This patch applies on top of Paolo's "[PATCH] KVM: nVMX: do not pin the VMCS12". > > (http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1455166.html) > > Thanks, I think Radim should first apply the RCU-on-teardown patch > (which I'll resend formally today), then "do not pin the VMCS12", then > these two. > > Reviewed-by: Paolo Bonzini Applied in that order, thanks.