summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDeng-Cheng Zhu <dengcheng.zhu@imgtec.com>2014-06-26 23:11:40 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-30 18:52:04 +0400
commitab76228a48d434d67cf72f8753307db104e81cc6 (patch)
tree78a5e604ab8d0b3cabfa1118c9ce2c7d386defc9 /arch
parentdb2fb7f202ba1d1b2c6532b359b7c763bf17fe72 (diff)
downloadlinux-ab76228a48d434d67cf72f8753307db104e81cc6.tar.xz
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kvm/emulate.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index 1a6068892e66..fb3e8dfd1ff6 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -846,11 +846,6 @@ enum emulation_result kvm_mips_emul_tlbwr(struct kvm_vcpu *vcpu)
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];
/*