From: Roel Kluin <roel.kluin@gmail.com>
To: avi@redhat.com, paulmck@linux.vnet.ibm.com
Cc: linuxppc-dev@ozlabs.org,
Andrew Morton <akpm@linux-foundation.org>,
kvm@vger.kernel.org
Subject: [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb
Date: Thu, 21 May 2009 21:53:13 +0200 [thread overview]
Message-ID: <4A15B129.8070700@gmail.com> (raw)
Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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;
WARNING: multiple messages have this Message-ID (diff)
From: Roel Kluin <roel.kluin@gmail.com>
To: avi@redhat.com, paulmck@linux.vnet.ibm.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
kvm@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb
Date: Thu, 21 May 2009 21:53:13 +0200 [thread overview]
Message-ID: <4A15B129.8070700@gmail.com> (raw)
Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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;
next reply other threads:[~2009-05-21 19:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 19:53 Roel Kluin [this message]
2009-05-21 19:53 ` [PATCH] KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb Roel Kluin
2009-05-31 12:00 ` Avi Kivity
2009-05-31 12:00 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A15B129.8070700@gmail.com \
--to=roel.kluin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulmck@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.