Skip to contentSkip to conversation

KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb

PATCH In review Roel Kluin 2 participants 2 messages May 21, 2009 – May 31, 2009

Subsystems (3)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 KVM: powerpc: beyond ARRAY_SIZE of vcpu->arch.guest_tlb

Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb

---

arch/powerpc/kvm/emulate.c +1 -1
index 0fce4fb..c2cfd46 100644
@@ -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;
#1 lore raw
Quoted 10 lines · Roel Kluin

Do not go beyond ARRAY_SIZE of vcpu->arch.guest_tlb

---

arch/powerpc/kvm/emulate.c +0 -0
index 0fce4fb..c2cfd46 100644

arch/powerpc/kvm/emulate.c static int kvmppc_emul_tlbwe(struct kvm_vcpu *vcpu, u32 inst) · line 131

Quoted 8 lines
arch/powerpc/kvm/emulate.c +1 -1
@@ -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;

This code no longer exists in kvm.git.

Signature · 1 line
error compiling committee.c: too many arguments to function