Re: [PATCH] hv: tlfs: fix the incorrect vLAPIC freq MSR


Eddie Dong
 

That is fine.

-----Original Message-----
From: Chen, Jian Jun <jian.jun.chen@...>
Sent: Monday, July 18, 2022 7:21 PM
To: acrn-dev@...
Cc: Dong, Eddie <eddie.dong@...>; Mao, Junjie <junjie.mao@...>;
Li, Fei1 <fei1.li@...>; Zhao, Yakui <yakui.zhao@...>; Chen, Jian
Jun <jian.jun.chen@...>
Subject: [PATCH] hv: tlfs: fix the incorrect vLAPIC freq MSR

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@...>
---
hypervisor/arch/x86/guest/hyperv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hypervisor/arch/x86/guest/hyperv.c
b/hypervisor/arch/x86/guest/hyperv.c
index 3022317fa..43f95f460 100644
--- a/hypervisor/arch/x86/guest/hyperv.c
+++ b/hypervisor/arch/x86/guest/hyperv.c
@@ -212,8 +212,8 @@ hyperv_rdmsr(struct acrn_vcpu *vcpu, uint32_t msr,
uint64_t *rval)
*rval = get_tsc_khz() * 1000UL;
break;
case HV_X64_MSR_APIC_FREQUENCY:
- /* both KVM and XEN hardcode the APIC freq as 1GHz ... */
- *rval = 1000000000UL;
+ /* vLAPIC freq is the same as TSC freq */
+ *rval = get_tsc_khz() * 1000UL;
break;
default:
pr_err("hv: %s: unexpected MSR[0x%x] read", __func__, msr);
--
2.35.1

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.