mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
cef061d086
commit
cf1fb0f29d
|
@ -2307,7 +2307,7 @@ enum emulation_result kvm_mips_handle_ri(u32 cause, u32 *opc,
|
||||||
}
|
}
|
||||||
switch (rd) {
|
switch (rd) {
|
||||||
case MIPS_HWR_CPUNUM: /* CPU number */
|
case MIPS_HWR_CPUNUM: /* CPU number */
|
||||||
arch->gprs[rt] = 0;
|
arch->gprs[rt] = vcpu->vcpu_id;
|
||||||
break;
|
break;
|
||||||
case MIPS_HWR_SYNCISTEP: /* SYNCI length */
|
case MIPS_HWR_SYNCISTEP: /* SYNCI length */
|
||||||
arch->gprs[rt] = min(current_cpu_data.dcache.linesz,
|
arch->gprs[rt] = min(current_cpu_data.dcache.linesz,
|
||||||
|
|
Loading…
Reference in New Issue