Skip to content

Commit ab76228

Browse files
dczhubonzini
authored andcommitted
MIPS: KVM: Remove dead code of TLB index error in kvm_mips_emul_tlbwr()
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>
1 parent db2fb7f commit ab76228

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎arch/mips/kvm/emulate.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -846,11 +846,6 @@ enum emulation_result kvm_mips_emul_tlbwr(struct kvm_vcpu *vcpu)
846846
get_random_bytes(&index, sizeof(index));
847847
index &= (KVM_MIPS_GUEST_TLB_SIZE - 1);
848848

849-
if (index < 0 || index >= KVM_MIPS_GUEST_TLB_SIZE) {
850-
kvm_err("%s: illegal index: %d\n", __func__, index);
851-
return EMULATE_FAIL;
852-
}
853-
854849
tlb = &vcpu->arch.guest_tlb[index];
855850

856851
/*

0 commit comments

Comments
 (0)