From: Hollis Blanchard Subject: Re: [PATCH 5 of 5] [kvm powerpc] Report bad GFNs Date: Thu, 22 May 2008 09:02:52 -0500 Message-ID: <200805220902.53093.hollisb@us.ibm.com> References: <43830c96d3d0b1e6411d.1211412175@localhost.localdomain> <4834DECC.8000301@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: avi@qumranet.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Anthony Liguori Return-path: Received: from e31.co.us.ibm.com ([32.97.110.149]:36442 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750827AbYEVOKj (ORCPT ); Thu, 22 May 2008 10:10:39 -0400 In-Reply-To: <4834DECC.8000301@codemonkey.ws> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 21 May 2008 21:47:40 Anthony Liguori wrote: > Hollis Blanchard wrote: > > This code shouldn't be hit anyways, but when it is, it's useful to have a > > little more information about the failure. > > > > Signed-off-by: Hollis Blanchard > > > > diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c > > --- a/arch/powerpc/kvm/44x_tlb.c > > +++ b/arch/powerpc/kvm/44x_tlb.c > > @@ -145,7 +145,7 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcp > > down_read(¤t->mm->mmap_sem); > > new_page = gfn_to_page(vcpu->kvm, gfn); > > if (is_error_page(new_page)) { > > - printk(KERN_ERR "Couldn't get guest page!\n"); > > + printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn); > > kvm_release_page_clean(new_page); > > up_read(¤t->mm->mmap_sem); > > return; > > > > FWIW, you should probably rate limit this sort of thing if this is what > would get triggered if the guest tried to program the tlb with an > invalid gfn. That was my initial thought as well, but in general, kvmppc_mmu_map() is only called if a TLB entry is "safe" -- meaning kvm_is_visible_gfn(kvm, gfn) was true. So in the absence of bugs elsewhere, this should never happen... but we know how that goes. ;) Anyways, that's why I'm not worried about rate limiting here. -- Hollis Blanchard IBM Linux Technology Center