From: Paul Mackerras Date: Mon, 21 Sep 2015 07:59:27 +0000 Subject: Re: [PATCH] KVM: PPC: Take the kvm->srcu lock in kvmppc_h_logical_ci_load/store() Message-Id: <20150921075927.GA7835@fergus.ozlabs.ibm.com> List-Id: References: <1442559448-1947-1-git-send-email-thuth@redhat.com> <20150921013708.GF20331@voom.fritz.box> <55FF9A9E.6070205@redhat.com> In-Reply-To: <55FF9A9E.6070205@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paolo Bonzini Cc: David Gibson , Thomas Huth , kvm-ppc@vger.kernel.org, Alexander Graf , kvm@vger.kernel.org On Mon, Sep 21, 2015 at 07:50:22AM +0200, Paolo Bonzini wrote: > > > On 21/09/2015 03:37, David Gibson wrote: > > On Fri, Sep 18, 2015 at 08:57:28AM +0200, Thomas Huth wrote: > >> Access to the kvm->buses (like with the kvm_io_bus_read() and > >> -write() functions) has to be protected via the kvm->srcu lock. > >> The kvmppc_h_logical_ci_load() and -store() functions are > >> missing this lock so far, so let's add it there, too. This fixes > >> the problem that the kernel reports "suspicious RCU usage" when > >> lock debugging is enabled. > >> > >> Fixes: 99342cf8044420eebdf9297ca03a14cb6a7085a1 Signed-off-by: > >> Thomas Huth > > > > Nice catch. Looks like I missed this because the places > > kvm_io_bus_{read,write}() are called on x86 are buried about 5 > > layers below where the srcu lock is taken :/. > > > > Reviewed-by: David Gibson ... > Paul, > > shall I take this directly into my tree for -rc3? > > Paolo I have that and two other fixes in my kvm-ppc-fixes branch on kernel.org. They were in linux-next today. I was going to send you a pull request tomorrow, but if you are about to send stuff off to Linus you could pull now from: git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git kvm-ppc-fixes The three patches in there are: Gautham R. Shenoy (1): KVM: PPC: Book3S HV: Pass the correct trap argument to kvmhv_commence_exit Paul Mackerras (1): KVM: PPC: Book3S HV: Fix handling of interrupted VCPUs Thomas Huth (1): KVM: PPC: Book3S: Take the kvm->srcu lock in kvmppc_h_logical_ci_load/store() The one from Gautham is a 1-liner that has been around for months and got missed, and is obviously correct. The one from me fixes a regression that was introduced in 4.3-rc1 by one of my patches, which causes oopses and soft lockups due to a use-after-free bug. Thanks, Paul.