File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -786,6 +786,27 @@ static int vt_set_identity_map_addr(struct kvm *kvm, u64 ident_addr)
786
786
return vmx_set_identity_map_addr (kvm , ident_addr );
787
787
}
788
788
789
+ #ifdef CONFIG_X86_64
790
+ static int vt_set_hv_timer (struct kvm_vcpu * vcpu , u64 guest_deadline_tsc ,
791
+ bool * expired )
792
+ {
793
+ /* VMX-preemption timer isn't available for TDX. */
794
+ if (is_td_vcpu (vcpu ))
795
+ return - EINVAL ;
796
+
797
+ return vmx_set_hv_timer (vcpu , guest_deadline_tsc , expired );
798
+ }
799
+
800
+ static void vt_cancel_hv_timer (struct kvm_vcpu * vcpu )
801
+ {
802
+ /* VMX-preemption timer can't be set. See vt_set_hv_timer(). */
803
+ if (is_td_vcpu (vcpu ))
804
+ return ;
805
+
806
+ vmx_cancel_hv_timer (vcpu );
807
+ }
808
+ #endif
809
+
789
810
static int vt_mem_enc_ioctl (struct kvm * kvm , void __user * argp )
790
811
{
791
812
if (!is_td (kvm ))
@@ -941,8 +962,8 @@ struct kvm_x86_ops vt_x86_ops __initdata = {
941
962
.pi_start_assignment = vmx_pi_start_assignment ,
942
963
943
964
#ifdef CONFIG_X86_64
944
- .set_hv_timer = vmx_set_hv_timer ,
945
- .cancel_hv_timer = vmx_cancel_hv_timer ,
965
+ .set_hv_timer = vt_set_hv_timer ,
966
+ .cancel_hv_timer = vt_cancel_hv_timer ,
946
967
#endif
947
968
948
969
.setup_mce = vmx_setup_mce ,
You can’t perform that action at this time.
0 commit comments