All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: ppc: beyond ARRAY_SIZE of vcpu_44x->guest_tlb
@ 2009-05-19 22:50 Roel Kluin
  2009-05-20 15:09 ` Hollis Blanchard
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-05-19 22:50 UTC (permalink / raw)
  To: kvm-ppc

Do not go beyond ARRAY_SIZE of vcpu_44x->guest_tlb

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: ppc: beyond ARRAY_SIZE of vcpu_44x->guest_tlb
  2009-05-19 22:50 [PATCH] KVM: ppc: beyond ARRAY_SIZE of vcpu_44x->guest_tlb Roel Kluin
@ 2009-05-20 15:09 ` Hollis Blanchard
  0 siblings, 0 replies; 2+ messages in thread
From: Hollis Blanchard @ 2009-05-20 15:09 UTC (permalink / raw)
  To: kvm-ppc

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 <roel.kluin@gmail.com>
> ---
> 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 <hollisb@us.ibm.com>

Thanks.

-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-20 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 22:50 [PATCH] KVM: ppc: beyond ARRAY_SIZE of vcpu_44x->guest_tlb Roel Kluin
2009-05-20 15:09 ` Hollis Blanchard

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.