Skip to content

Commit cf1fb0f

Browse files
James Hoganbonzini
authored andcommitted
MIPS: KVM: Emulate RDHWR CPUNum register
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>
1 parent cef061d commit cf1fb0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/kvm/emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2307,7 +2307,7 @@ enum emulation_result kvm_mips_handle_ri(u32 cause, u32 *opc,
23072307
}
23082308
switch (rd) {
23092309
case MIPS_HWR_CPUNUM: /* CPU number */
2310-
arch->gprs[rt] = 0;
2310+
arch->gprs[rt] = vcpu->vcpu_id;
23112311
break;
23122312
case MIPS_HWR_SYNCISTEP: /* SYNCI length */
23132313
arch->gprs[rt] = min(current_cpu_data.dcache.linesz,

0 commit comments

Comments
 (0)