It's impossible to fall into the error handling of the TLB index after
being masked by (KVM_MIPS_GUEST_TLB_SIZE - 1). Remove the dead code.
Reported-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
get_random_bytes(&index, sizeof(index));
index &= (KVM_MIPS_GUEST_TLB_SIZE - 1);
- if (index < 0 || index >= KVM_MIPS_GUEST_TLB_SIZE) {
- kvm_err("%s: illegal index: %d\n", __func__, index);
- return EMULATE_FAIL;
- }
-
tlb = &vcpu->arch.guest_tlb[index];
/*