acrn-hypervisor/hypervisor/arch/x86
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
..
boot HV: modularization: rename multiboot.h to boot.h 2021-06-11 10:06:02 +08:00
configs HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
guest hv: initialize and save/restore IA32_TSC_AUX MSR for guest 2021-11-12 09:30:12 +08:00
lib HV: rewrite memcpy_s to be iso c11 compliant 2020-06-08 13:30:04 +08:00
seed ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
cpu.c hv: vCAT: initialize the emulated_guest_msrs array for CAT msrs during platform initialization 2021-10-26 11:48:27 +08:00
cpu_caps.c HV: treewide: fix violations of coding guideline C-TY-12 2021-11-04 18:15:47 +08:00
cpu_state_tbl.c HV: treewide: fix violations of coding guideline C-TY-12 2021-11-04 18:15:47 +08:00
e820.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
exception.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
gdt.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
idt.S hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
init.c HV: modularization: add boot.c to wrap multiboot module 2021-06-11 10:06:02 +08:00
ioapic.c hv: paging: rename ppt_set/clear_ATTR to set_paging_ATTR 2021-05-14 09:18:00 +08:00
irq.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
lapic.c hv/mod_timer: separate delay functions from the timer module 2021-05-18 16:43:28 +08:00
mmu.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
nmi.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
notify.c ACRN: hv: Terminology modification in hv code 2021-11-02 10:00:55 +08:00
page.c HV: treewide: fix violations of coding guideline C-EP-05 2021-11-04 18:15:47 +08:00
pagetable.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
platform_caps.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
pm.c hv: dm: Use new power management data structures 2021-07-15 11:53:54 +08:00
rdt.c hv: vCAT: initialize vCAT MSRs during vmcs init 2021-10-28 19:12:29 +08:00
rtcm.c hv: update RTCT ACPI table detecting 2021-06-01 08:22:20 +08:00
sched.S hv: sched: rename schedule related structs and vars 2019-10-16 10:25:53 +08:00
security.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
sgx.c hv: mod: do not use explicit arch name when including headers 2021-05-08 11:15:46 +08:00
trampoline.c HV: treewide: fix violations of coding guideline C-TY-12 2021-11-04 18:15:47 +08:00
tsc.c hv/mod_timer: split tsc handling code from timer. 2021-05-18 16:43:28 +08:00
tsc_deadline_timer.c HV: arch: fix a violation of coding guideline C-TY-24 2021-11-04 18:15:47 +08:00
vmx.c hv: VMPTRLD and VMCLEAR VMCS with the common APIs 2021-05-26 11:22:26 +08:00
vtd.c HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28 2021-11-04 18:15:47 +08:00
wakeup.S hv: pm: correct the function name 2019-09-11 17:30:24 +08:00