Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933183AbeAKKCB (ORCPT + 1 other); Thu, 11 Jan 2018 05:02:01 -0500 Received: from ozlabs.org ([103.22.144.67]:47095 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932394AbeAKKBz (ORCPT ); Thu, 11 Jan 2018 05:01:55 -0500 Date: Thu, 11 Jan 2018 20:54:51 +1100 From: Paul Mackerras To: David Gibson Cc: surajjs@au1.ibm.com, spopovyc@redhat.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt() Message-ID: <20180111095451.GG24294@fergus.ozlabs.ibm.com> References: <20180110060439.21822-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180110060439.21822-1-david@gibson.dropbear.id.au> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 10, 2018 at 05:04:39PM +1100, David Gibson wrote: > The KVM_PPC_ALLOCATE_HTAB ioctl(), implemented by kvmppc_alloc_reset_hpt() > is supposed to completely clear and reset a guest's Hashed Page Table (HPT) > allocating or re-allocating it if necessary. > > In the case where an HPT of the right size already exists and it just > zeroes it, it forces a TLB flush on all guest CPUs, to remove any stale TLB > entries loaded from the old HPT. > > However, that situation can arise when the HPT is resizing as well - or > even when switching from an RPT to HPT - so those cases need a TLB flush as > well. > > So, move the TLB flush to trigger in all cases except for errors. > > Signed-off-by: David Gibson > --- > arch/powerpc/kvm/book3s_64_mmu_hv.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > Paul, this is based on Paolo's KVM tree, but it should apply without > modification to pretty much any vaguely current tree. It's a pretty > nasty bug - the case we've found hitting it in the wild is a bit > esoteric, but it could in theory affect other situations as well. > > Please apply ASAP, and should probably be queued for the stable > branches as well. Thanks, applied to my kvm-ppc-fixes branch, and I added cc: stable@vger.kernel.org. Paul.