From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from legacy.ddn.com ([64.47.133.206]:35553 "EHLO legacy.ddn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbcKVVAI (ORCPT ); Tue, 22 Nov 2016 16:00:08 -0500 Date: Tue, 22 Nov 2016 13:55:31 -0700 From: Greg Edwards To: Paolo Bonzini CC: , , Subject: Re: [PATCH] kvm: vmx: ensure VMCS is current while enabling PML Message-ID: <20161122205531.GB6919@psuche> References: <20161122154352.25784-2-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161122154352.25784-2-pbonzini@redhat.com> Sender: stable-owner@vger.kernel.org List-ID: On Tue, Nov 22, 2016 at 04:43:52PM +0100, Paolo Bonzini wrote: > From: Peter Feiner > > [ upstream commit 4e59516a12a6ef6dcb660cb3a3f70c64bd60cfec, for 4.1.y only ] > > Between loading the new VMCS and enabling PML, the CPU was unpinned. > If the vCPU thread were migrated to another CPU in the interim (e.g., > due to preemption or sleeping alloc_page), then the VMWRITEs to enable > PML would target the wrong VMCS -- or no VMCS at all: > > [ 2087.266950] vmwrite error: reg 200e value 3fe1d52000 (err -506126336) > [ 2087.267062] vmwrite error: reg 812 value 1ff (err 511) > [ 2087.267125] vmwrite error: reg 401e value 12229c00 (err 304258048) > > This patch ensures that the VMCS remains current while enabling PML by > doing the VMWRITEs while the CPU is pinned. Allocation of the PML buffer > is hoisted out of the critical section. > > Signed-off-by: Peter Feiner > Signed-off-by: Paolo Bonzini Tested-by: Greg Edwards