From patchwork Thu May 21 19:53:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 25284 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4LJrIc8005716 for ; Thu, 21 May 2009 19:53:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754578AbZEUTxO (ORCPT ); Thu, 21 May 2009 15:53:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753703AbZEUTxO (ORCPT ); Thu, 21 May 2009 15:53:14 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:62848 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753362AbZEUTxO (ORCPT ); Thu, 21 May 2009 15:53:14 -0400 Received: by ewy24 with SMTP id 24so1446456ewy.37 for ; Thu, 21 May 2009 12:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=q9MYq/DcxmgnpdcWbm6qUerKU8sYd3WXjCyejDBtLO4=; b=GomylvaHPPkjjX8AM78hkrRqrtPBUOfPGFvoDYOYcKViMCFTkSgpn7QvYmbwdp3Spo i+IBGIMrxp0AHLgWYA2uOWwQBkSrw9ViCW1SfRReAI80tSie/TtbstBIMoPZBZJJEavU MdCWOXmBd0FpOaWhKau/AuV3awZyf1W6QiN04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=fMJ4/1txSnRmxZkuthV6bA3m3WejCixoaa+DtypnwIUq9pVtCMKuU38b/+as0ZCGpa 4oQRFsVyBy2RCvclCp4JIlHhngdZ6v5ciLsN+rWQg+h2bGt2veRWDlHMM17gdHBr16hx W1QwUAbO0hlvc+tY7xAF4NEozZM8WvCeEF+l8= Received: by 10.210.126.18 with SMTP id y18mr9517040ebc.12.1242935594632; Thu, 21 May 2009 12:53:14 -0700 (PDT) Received: from ?192.168.1.2? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm284608eyh.30.2009.05.21.12.53.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 May 2009 12:53:13 -0700 (PDT) Message-ID: <4A15B129.8070700@gmail.com> Date: Thu, 21 May 2009 21:53:13 +0200 From: Roel Kluin User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: avi@redhat.com, paulmck@linux.vnet.ibm.com CC: Andrew Morton , kvm@vger.kernel.org, linuxppc-dev@ozlabs.org Subject: [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;