MIPS: KVM: Emulate RDHWR CPUNum register
authorJames Hogan <james.hogan@imgtec.com>
Wed, 15 Jun 2016 18:29:55 +0000 (19:29 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2016 21:58:35 +0000 (23:58 +0200)
Actually provide the VCPU number when emulating the RDHWR CPUNum
register, so that it will match the CPUNum field of CP0_EBase register,
rather than always returning 0.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/mips/kvm/emulate.c

index 84f435bf74bd38aca6f5ff5b77a4ed37b6aa0c60..4ca5450febbb8c68539d54b8435c741535bab091 100644 (file)
@@ -2307,7 +2307,7 @@ enum emulation_result kvm_mips_handle_ri(u32 cause, u32 *opc,
                }
                switch (rd) {
                case MIPS_HWR_CPUNUM:           /* CPU number */
-                       arch->gprs[rt] = 0;
+                       arch->gprs[rt] = vcpu->vcpu_id;
                        break;
                case MIPS_HWR_SYNCISTEP:        /* SYNCI length */
                        arch->gprs[rt] = min(current_cpu_data.dcache.linesz,
This page took 0.027351 seconds and 5 git commands to generate.