Commit 4f018c51 authored by Roel Kluin's avatar Roel Kluin Committed by Marcelo Tosatti

KVM: PPC: Keep index within boundaries in kvmppc_44x_emul_tlbwe()

An index of KVM44x_GUEST_TLB_SIZE is already one too large.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarHollis Blanchard <hollis@penguinppc.org>
Acked-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent f8c5fae1
...@@ -440,7 +440,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws) ...@@ -440,7 +440,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
unsigned int gtlb_index; unsigned int gtlb_index;
gtlb_index = kvmppc_get_gpr(vcpu, ra); gtlb_index = kvmppc_get_gpr(vcpu, ra);
if (gtlb_index > KVM44x_GUEST_TLB_SIZE) { if (gtlb_index >= KVM44x_GUEST_TLB_SIZE) {
printk("%s: index %d\n", __func__, gtlb_index); printk("%s: index %d\n", __func__, gtlb_index);
kvmppc_dump_vcpu(vcpu); kvmppc_dump_vcpu(vcpu);
return EMULATE_FAIL; return EMULATE_FAIL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment