Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: KVM: Remove dead code in CP0 emulation

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>

authored by

James Hogan and committed by
Paolo Bonzini
36c95494 26f4f3b5

-7
-7
arch/mips/kvm/kvm_mips_emul.c
··· 436 436 sel = inst & 0x7; 437 437 co_bit = (inst >> 25) & 1; 438 438 439 - /* Verify that the register is valid */ 440 - if (rd > MIPS_CP0_DESAVE) { 441 - printk("Invalid rd: %d\n", rd); 442 - er = EMULATE_FAIL; 443 - goto done; 444 - } 445 - 446 439 if (co_bit) { 447 440 op = (inst) & 0xff; 448 441