mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
hv: tlfs: fix the incorrect vLAPIC freq MSR
When LAPIC timer is working in oneshot or periodic mode, OS uses initial counter register/current counter register to program a timer. Both initial counter and current counter depend on the LAPIC frequency. ACRN emulated vLAPIC timer based on the TSC. vLAPIC freq is the same as TSC freq. Tracked-On: #7876 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
parent
a3449c4893
commit
22a302599a
@ -212,8 +212,8 @@ hyperv_rdmsr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t *rval)
|
|||||||
*rval = get_tsc_khz() * 1000UL;
|
*rval = get_tsc_khz() * 1000UL;
|
||||||
break;
|
break;
|
||||||
case HV_X64_MSR_APIC_FREQUENCY:
|
case HV_X64_MSR_APIC_FREQUENCY:
|
||||||
/* both KVM and XEN hardcode the APIC freq as 1GHz ... */
|
/* vLAPIC freq is the same as TSC freq */
|
||||||
*rval = 1000000000UL;
|
*rval = get_tsc_khz() * 1000UL;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_err("hv: %s: unexpected MSR[0x%x] read", __func__, msr);
|
pr_err("hv: %s: unexpected MSR[0x%x] read", __func__, msr);
|
||||||
|
Loading…
Reference in New Issue
Block a user