From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ew0-f167.google.com (mail-ew0-f167.google.com [209.85.219.167]) by ozlabs.org (Postfix) with ESMTP id EF61BDDDA9 for ; Fri, 22 May 2009 05:53:16 +1000 (EST) Received: by ewy11 with SMTP id 11so1475261ewy.9 for ; Thu, 21 May 2009 12:53:14 -0700 (PDT) Message-ID: <4A15B129.8070700@gmail.com> Date: Thu, 21 May 2009 21:53:13 +0200 From: Roel Kluin MIME-Version: 1.0 To: avi@redhat.com, paulmck@linux.vnet.ibm.com Subject: [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb Content-Type: text/plain; charset=ISO-8859-1 Cc: linuxppc-dev@ozlabs.org, Andrew Morton , kvm@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb Signed-off-by: Roel Kluin --- diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c index 0fce4fb..c2cfd46 100644 --- a/arch/powerpc/kvm/emulate.c +++ b/arch/powerpc/kvm/emulate.c @@ -125,7 +125,7 @@ static int kvmppc_emul_tlbwe(struct kvm_vcpu *vcpu, u32 inst) ws = get_ws(inst); index = vcpu->arch.gpr[ra]; - if (index > PPC44x_TLB_SIZE) { + if (index >= PPC44x_TLB_SIZE) { printk("%s: index %d\n", __func__, index); kvmppc_dump_vcpu(vcpu); return EMULATE_FAIL;