Skip to content

Commit 502eefb

Browse files
committed
pKVM: VMX: Use safe version MSR accessing wrapper to setup uret MSRs
Now the pKVM exception table is supported. The safe version MSR wrappers can be used to access MSR in the pKVM. Remove the specific workaround used for setup uret MSRs. Signed-off-by: Chuanxiao Dong <[email protected]>
1 parent 77bd40d commit 502eefb

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8696,25 +8696,8 @@ static __init void vmx_setup_user_return_msrs(void)
86968696

86978697
BUILD_BUG_ON(ARRAY_SIZE(vmx_uret_msrs_list) != MAX_NR_USER_RETURN_MSRS);
86988698

8699-
#ifndef __PKVM_HYP__
87008699
for (i = 0; i < ARRAY_SIZE(vmx_uret_msrs_list); ++i)
87018700
kvm_add_user_return_msr(vmx_uret_msrs_list[i]);
8702-
#else
8703-
for (i = 0; i < ARRAY_SIZE(vmx_uret_msrs_list); ++i) {
8704-
/*
8705-
* TODO: As pKVM doesn't implement exception table so cannot
8706-
* handle the exception generated by accessing MSR. To avoid
8707-
* this, check cpu capability first before accessing a MSR which
8708-
* might be not able to support. Once exception table is
8709-
* supported, this can be removed.
8710-
*/
8711-
if (vmx_uret_msrs_list[i] == MSR_IA32_TSX_CTRL &&
8712-
!boot_cpu_has(X86_FEATURE_MSR_TSX_CTRL))
8713-
continue;
8714-
8715-
kvm_add_user_return_msr(vmx_uret_msrs_list[i]);
8716-
}
8717-
#endif
87188701
}
87198702

87208703
#ifndef __PKVM_HYP__

0 commit comments

Comments
 (0)