Lines Matching refs:pi_desc
34 static inline struct pi_desc *vcpu_to_pi_desc(struct kvm_vcpu *vcpu) in vcpu_to_pi_desc()
36 return &(to_vmx(vcpu)->pi_desc); in vcpu_to_pi_desc()
39 static int pi_try_set_control(struct pi_desc *pi_desc, u64 *pold, u64 new) in pi_try_set_control() argument
47 if (!try_cmpxchg64(&pi_desc->control, pold, new)) in pi_try_set_control()
55 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); in vmx_vcpu_pi_load() local
57 struct pi_desc old, new; in vmx_vcpu_pi_load()
74 if (pi_desc->nv != POSTED_INTR_WAKEUP_VECTOR && vcpu->cpu == cpu) { in vmx_vcpu_pi_load()
79 if (pi_test_and_clear_sn(pi_desc)) in vmx_vcpu_pi_load()
91 if (pi_desc->nv == POSTED_INTR_WAKEUP_VECTOR) { in vmx_vcpu_pi_load()
101 old.control = READ_ONCE(pi_desc->control); in vmx_vcpu_pi_load()
117 } while (pi_try_set_control(pi_desc, &old.control, new.control)); in vmx_vcpu_pi_load()
131 if (!pi_is_pir_empty(pi_desc)) in vmx_vcpu_pi_load()
132 pi_set_on(pi_desc); in vmx_vcpu_pi_load()
148 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); in pi_enable_wakeup_handler() local
150 struct pi_desc old, new; in pi_enable_wakeup_handler()
160 WARN(pi_desc->sn, "PI descriptor SN field set before blocking"); in pi_enable_wakeup_handler()
162 old.control = READ_ONCE(pi_desc->control); in pi_enable_wakeup_handler()
167 } while (pi_try_set_control(pi_desc, &old.control, new.control)); in pi_enable_wakeup_handler()
198 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); in vmx_vcpu_pi_put() local
212 pi_set_sn(pi_desc); in vmx_vcpu_pi_put()
228 if (pi_test_on(&vmx->pi_desc)) in pi_wakeup_handler()
242 struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu); in pi_has_pending_interrupt() local
244 return pi_test_on(pi_desc) || in pi_has_pending_interrupt()
245 (pi_test_sn(pi_desc) && !pi_is_pir_empty(pi_desc)); in pi_has_pending_interrupt()