acrn-hypervisor/hypervisor/arch/x86/guest
Shiqing Gao 7bbd17ce80 hv: initialize and save/restore IA32_TSC_AUX MSR for guest
Commit cbf3825 "hv: Pass-through IA32_TSC_AUX MSR to L1 guest"
lets guest own the physical MSR IA32_TSC_AUX and does not handle this MSR
in the hypervisor.
If multiple vCPUs share the same pCPU, when one vCPU reads MSR IA32_TSC_AUX,
it may get the value set by other vCPUs.

To fix this issue, this patch does:
 - initialize the MSR content to 0 for the given vCPU, which is consistent with
   the value specified in SDM Vol3 "Table 9-1. IA-32 and Intel 64 Processor
   States Following Power-up, Reset, or INIT"
 - save/restore the MSR content for the given vCPU during context switch

v1 -> v2:
 * According to Table 9-1, the content of IA32_TSC_AUX MSR is unchanged
   following INIT, v2 updates the initialization logic so that the content for
   vCPU is consistent with SDM.

Tracked-On: #6799
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Zide Chen <zide.chen@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
2021-11-12 09:30:12 +08:00
..
assign.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
ept.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
guest_memory.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
hyperv.c hv/mod_timer: split tsc handling code from timer. 2021-05-18 16:43:28 +08:00
instr_emul.c HV: treewide: fix violations of coding guideline C-TY-02 2021-11-04 18:15:47 +08:00
lock_instr_emul.c hv: Fix vcpu signaling racing problem in lock instruction emulation 2021-11-02 15:01:20 +08:00
nested.c hv: operations on vcpu->reg_cached/reg_updated don't need LOCK prefix 2021-10-08 09:11:10 +08:00
pm.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
trusty.c hv: initialize and save/restore IA32_TSC_AUX MSR for guest 2021-11-12 09:30:12 +08:00
ucode.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
vcat.c hv: vCAT: propagate vCBM to other vCPUs that share cache with vcpu 2021-10-28 19:12:29 +08:00
vcpu.c hv: initialize and save/restore IA32_TSC_AUX MSR for guest 2021-11-12 09:30:12 +08:00
vcpuid.c ACRN: hv: Unify terminology for service vm 2021-11-02 10:00:55 +08:00
ve820.c HV: refine the ve820 tab for pre-VMs 2021-11-08 13:13:14 +08:00
vept.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
virq.c hv: Fix vcpu signaling racing problem in lock instruction emulation 2021-11-02 15:01:20 +08:00
virtual_cr.c HV: treewide: fix violations of coding guideline C-TY-02 2021-11-04 18:15:47 +08:00
vlapic_priv.h hv: add ops to vlapic structure 2019-07-19 16:47:06 +08:00
vlapic.c HV: treewide: fix warnings raised by Clang 2021-11-04 18:15:47 +08:00
vm_reset.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
vm.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
vmcall.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
vmcs.c hv:change log level for check_vmx_ctrl 2021-09-24 10:17:19 +08:00
vmexit.c HV: treewide: fix warnings raised by Clang 2021-11-04 18:15:47 +08:00
vmsr.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
vmtrr.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
vmx_asm.S hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
vmx_io.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00