mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 10:04:42 +00:00
hv: emulate IA32_TSC_ADJUST MSR
Intercept IA32_TSC_ADJUST MSR so that writing IA32_TSC_ADJUST from the guests won't impact the TSC in root mode or potentially other vCPUs in the same pCPU. - MSR TSC_ADJUST needs to be isolated between normal and secure world, so it's included in NUM_WORLD_MSRS. - Upon writing to either IA32_TSC_ADJUST or IA32_TSC from the guests, don't write to physical MSRS so it won't impact the host side, but update the TSC offset VM-execution control. - don't need to intercept rdmsr for IA32_TIME_STAMP_COUNTER. - add the missing statement in save_world_ctx() to save the tsc_offset during world switch. Tracked-On: #1867 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -167,6 +167,7 @@ static void save_world_ctx(struct acrn_vcpu *vcpu, struct ext_context *ext_ctx)
|
||||
(void)vcpu_get_rip(vcpu);
|
||||
|
||||
/* VMCS GUEST field */
|
||||
ext_ctx->tsc_offset = exec_vmread(VMX_TSC_OFFSET_FULL);
|
||||
ext_ctx->vmx_cr0 = exec_vmread(VMX_GUEST_CR0);
|
||||
ext_ctx->vmx_cr4 = exec_vmread(VMX_GUEST_CR4);
|
||||
ext_ctx->vmx_cr0_read_shadow = exec_vmread(VMX_CR0_READ_SHADOW);
|
||||
|
||||
Reference in New Issue
Block a user