MIPS: KVM: Remove dead code in CP0 emulation
authorJames Hogan <james.hogan@imgtec.com>
Fri, 14 Mar 2014 13:06:10 +0000 (13:06 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Mar 2014 16:01:50 +0000 (17:01 +0100)
The code to check whether rd > MIPS_CP0_DESAVE is dead code, since
MIPS_CP0_DESAVE = 31 and rd is already masked with 0x1f. Remove it.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sanjay Lal <sanjayl@kymasys.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/kvm_mips_emul.c

index d562572..e3fec99 100644 (file)
@@ -436,13 +436,6 @@ kvm_mips_emulate_CP0(uint32_t inst, uint32_t *opc, uint32_t cause,
        sel = inst & 0x7;
        co_bit = (inst >> 25) & 1;
 
-       /* Verify that the register is valid */
-       if (rd > MIPS_CP0_DESAVE) {
-               printk("Invalid rd: %d\n", rd);
-               er = EMULATE_FAIL;
-               goto done;
-       }
-
        if (co_bit) {
                op = (inst) & 0xff;