From: Hollis Blanchard Date: Wed, 20 May 2009 15:09:48 +0000 Subject: Re: [PATCH] KVM: ppc: beyond ARRAY_SIZE of vcpu_44x->guest_tlb Message-Id: <1242832188.13323.2.camel@slate.austin.ibm.com> List-Id: References: <4A1337B7.4090501@gmail.com> In-Reply-To: <4A1337B7.4090501@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Wed, 2009-05-20 at 00:50 +0200, Roel Kluin wrote: > Do not go beyond ARRAY_SIZE of vcpu_44x->guest_tlb > > Signed-off-by: Roel Kluin > --- > diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c > index 4a16f47..6093289 100644 > --- a/arch/powerpc/kvm/44x_tlb.c > +++ b/arch/powerpc/kvm/44x_tlb.c > @@ -439,7 +439,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws) > unsigned int gtlb_index; > > gtlb_index = vcpu->arch.gpr[ra]; > - if (gtlb_index > KVM44x_GUEST_TLB_SIZE) { > + if (gtlb_index >= KVM44x_GUEST_TLB_SIZE) { > printk("%s: index %d\n", __func__, gtlb_index); > kvmppc_dump_vcpu(vcpu); > return EMULATE_FAIL; Acked-by: Hollis Blanchard Thanks. -- Hollis Blanchard IBM Linux Technology Center