]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/mips/kvm/emulate.c
MIPS: KVM: Decode RDHWR more strictly
[mirror_ubuntu-artful-kernel.git] / arch / mips / kvm / emulate.c
index 62e6a7b313aea58c84827b1a6905aaf3125c2480..be18dfe9ecaa210b23f6e7c1dd1f1368efd675dc 100644 (file)
@@ -2357,7 +2357,9 @@ enum emulation_result kvm_mips_handle_ri(u32 cause, u32 *opc,
        }
 
        if (inst.r_format.opcode == spec3_op &&
-           inst.r_format.func == rdhwr_op) {
+           inst.r_format.func == rdhwr_op &&
+           inst.r_format.rs == 0 &&
+           (inst.r_format.re >> 3) == 0) {
                int usermode = !KVM_GUEST_KERNEL_MODE(vcpu);
                int rd = inst.r_format.rd;
                int rt = inst.r_format.rt;