Lines Matching refs:vcpu
64 static inline struct kvm_vcpu_hv *to_hv_vcpu(struct kvm_vcpu *vcpu) in to_hv_vcpu() argument
66 return vcpu->arch.hyperv; in to_hv_vcpu()
69 static inline struct kvm_vcpu_hv_synic *to_hv_synic(struct kvm_vcpu *vcpu) in to_hv_synic() argument
71 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in to_hv_synic()
80 return hv_vcpu->vcpu; in hv_synic_to_vcpu()
83 static inline struct kvm_hv_syndbg *to_hv_syndbg(struct kvm_vcpu *vcpu) in to_hv_syndbg() argument
85 return &vcpu->kvm->arch.hyperv.hv_syndbg; in to_hv_syndbg()
88 static inline u32 kvm_hv_get_vpindex(struct kvm_vcpu *vcpu) in kvm_hv_get_vpindex() argument
90 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in kvm_hv_get_vpindex()
92 return hv_vcpu ? hv_vcpu->vp_index : vcpu->vcpu_idx; in kvm_hv_get_vpindex()
95 int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host);
96 int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata, bool host);
98 static inline bool kvm_hv_hypercall_enabled(struct kvm_vcpu *vcpu) in kvm_hv_hypercall_enabled() argument
100 return vcpu->arch.hyperv_enabled && to_kvm_hv(vcpu->kvm)->hv_guest_os_id; in kvm_hv_hypercall_enabled()
103 int kvm_hv_hypercall(struct kvm_vcpu *vcpu);
107 void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int vector);
108 int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages);
110 static inline bool kvm_hv_synic_has_vector(struct kvm_vcpu *vcpu, int vector) in kvm_hv_synic_has_vector() argument
112 return to_hv_vcpu(vcpu) && test_bit(vector, to_hv_synic(vcpu)->vec_bitmap); in kvm_hv_synic_has_vector()
115 static inline bool kvm_hv_synic_auto_eoi_set(struct kvm_vcpu *vcpu, int vector) in kvm_hv_synic_auto_eoi_set() argument
117 return to_hv_vcpu(vcpu) && in kvm_hv_synic_auto_eoi_set()
118 test_bit(vector, to_hv_synic(vcpu)->auto_eoi_bitmap); in kvm_hv_synic_auto_eoi_set()
121 void kvm_hv_vcpu_uninit(struct kvm_vcpu *vcpu);
123 bool kvm_hv_assist_page_enabled(struct kvm_vcpu *vcpu);
124 int kvm_hv_get_assist_page(struct kvm_vcpu *vcpu);
126 static inline struct kvm_vcpu_hv_stimer *to_hv_stimer(struct kvm_vcpu *vcpu, in to_hv_stimer() argument
129 return &to_hv_vcpu(vcpu)->stimer[timer_index]; in to_hv_stimer()
138 return hv_vcpu->vcpu; in hv_stimer_to_vcpu()
141 static inline bool kvm_hv_has_stimer_pending(struct kvm_vcpu *vcpu) in kvm_hv_has_stimer_pending() argument
143 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in kvm_hv_has_stimer_pending()
156 static inline bool kvm_hv_invtsc_suppressed(struct kvm_vcpu *vcpu) in kvm_hv_invtsc_suppressed() argument
158 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in kvm_hv_invtsc_suppressed()
176 return !(to_kvm_hv(vcpu->kvm)->hv_invtsc_control & HV_EXPOSE_INVARIANT_TSC); in kvm_hv_invtsc_suppressed()
179 void kvm_hv_process_stimers(struct kvm_vcpu *vcpu);
185 void kvm_hv_xsaves_xsavec_maybe_warn(struct kvm_vcpu *vcpu);
189 int kvm_hv_vcpu_init(struct kvm_vcpu *vcpu);
190 void kvm_hv_set_cpuid(struct kvm_vcpu *vcpu, bool hyperv_enabled);
191 int kvm_hv_set_enforce_cpuid(struct kvm_vcpu *vcpu, bool enforce);
193 int kvm_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
196 static inline struct kvm_vcpu_hv_tlb_flush_fifo *kvm_hv_get_tlb_flush_fifo(struct kvm_vcpu *vcpu, in kvm_hv_get_tlb_flush_fifo() argument
199 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in kvm_hv_get_tlb_flush_fifo()
206 static inline void kvm_hv_vcpu_purge_flush_tlb(struct kvm_vcpu *vcpu) in kvm_hv_vcpu_purge_flush_tlb() argument
210 if (!to_hv_vcpu(vcpu) || !kvm_check_request(KVM_REQ_HV_TLB_FLUSH, vcpu)) in kvm_hv_vcpu_purge_flush_tlb()
213 tlb_flush_fifo = kvm_hv_get_tlb_flush_fifo(vcpu, is_guest_mode(vcpu)); in kvm_hv_vcpu_purge_flush_tlb()
218 static inline bool guest_hv_cpuid_has_l2_tlb_flush(struct kvm_vcpu *vcpu) in guest_hv_cpuid_has_l2_tlb_flush() argument
220 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in guest_hv_cpuid_has_l2_tlb_flush()
226 static inline bool kvm_hv_is_tlb_flush_hcall(struct kvm_vcpu *vcpu) in kvm_hv_is_tlb_flush_hcall() argument
228 struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu); in kvm_hv_is_tlb_flush_hcall()
234 code = is_64_bit_hypercall(vcpu) ? kvm_rcx_read(vcpu) : in kvm_hv_is_tlb_flush_hcall()
235 kvm_rax_read(vcpu); in kvm_hv_is_tlb_flush_hcall()
243 static inline int kvm_hv_verify_vp_assist(struct kvm_vcpu *vcpu) in kvm_hv_verify_vp_assist() argument
245 if (!to_hv_vcpu(vcpu)) in kvm_hv_verify_vp_assist()
248 if (!kvm_hv_assist_page_enabled(vcpu)) in kvm_hv_verify_vp_assist()
251 return kvm_hv_get_assist_page(vcpu); in kvm_hv_verify_vp_assist()
254 static inline void kvm_hv_nested_transtion_tlb_flush(struct kvm_vcpu *vcpu, in kvm_hv_nested_transtion_tlb_flush() argument
263 if (to_hv_vcpu(vcpu) && tdp_enabled) in kvm_hv_nested_transtion_tlb_flush()
264 kvm_make_request(KVM_REQ_HV_TLB_FLUSH, vcpu); in kvm_hv_nested_transtion_tlb_flush()
267 int kvm_hv_vcpu_flush_tlb(struct kvm_vcpu *vcpu);
272 static inline void kvm_hv_xsaves_xsavec_maybe_warn(struct kvm_vcpu *vcpu) {} in kvm_hv_xsaves_xsavec_maybe_warn() argument
275 static inline int kvm_hv_vcpu_init(struct kvm_vcpu *vcpu) in kvm_hv_vcpu_init() argument
279 static inline void kvm_hv_vcpu_uninit(struct kvm_vcpu *vcpu) {} in kvm_hv_vcpu_uninit() argument
280 static inline bool kvm_hv_hypercall_enabled(struct kvm_vcpu *vcpu) in kvm_hv_hypercall_enabled() argument
284 static inline int kvm_hv_hypercall(struct kvm_vcpu *vcpu) in kvm_hv_hypercall() argument
288 static inline void kvm_hv_vcpu_purge_flush_tlb(struct kvm_vcpu *vcpu) {} in kvm_hv_vcpu_purge_flush_tlb() argument
289 static inline bool kvm_hv_synic_has_vector(struct kvm_vcpu *vcpu, int vector) in kvm_hv_synic_has_vector() argument
293 static inline bool kvm_hv_synic_auto_eoi_set(struct kvm_vcpu *vcpu, int vector) in kvm_hv_synic_auto_eoi_set() argument
297 static inline void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int vector) {} in kvm_hv_synic_send_eoi() argument
298 static inline bool kvm_hv_invtsc_suppressed(struct kvm_vcpu *vcpu) in kvm_hv_invtsc_suppressed() argument
302 static inline void kvm_hv_set_cpuid(struct kvm_vcpu *vcpu, bool hyperv_enabled) {} in kvm_hv_set_cpuid() argument
303 static inline bool kvm_hv_has_stimer_pending(struct kvm_vcpu *vcpu) in kvm_hv_has_stimer_pending() argument
307 static inline bool kvm_hv_is_tlb_flush_hcall(struct kvm_vcpu *vcpu) in kvm_hv_is_tlb_flush_hcall() argument
311 static inline bool guest_hv_cpuid_has_l2_tlb_flush(struct kvm_vcpu *vcpu) in guest_hv_cpuid_has_l2_tlb_flush() argument
315 static inline int kvm_hv_verify_vp_assist(struct kvm_vcpu *vcpu) in kvm_hv_verify_vp_assist() argument
319 static inline u32 kvm_hv_get_vpindex(struct kvm_vcpu *vcpu) in kvm_hv_get_vpindex() argument
321 return vcpu->vcpu_idx; in kvm_hv_get_vpindex()
323 static inline void kvm_hv_nested_transtion_tlb_flush(struct kvm_vcpu *vcpu, bool tdp_enabled) {} in kvm_hv_nested_transtion_tlb_flush() argument