Lines Matching refs:gi

289 static inline u8 gisa_get_ipm_or_restore_iam(struct kvm_s390_gisa_interrupt *gi)  in gisa_get_ipm_or_restore_iam()  argument
295 word = READ_ONCE(gi->origin->u64.word[0]); in gisa_get_ipm_or_restore_iam()
296 alert_mask = READ_ONCE(gi->alert.mask); in gisa_get_ipm_or_restore_iam()
301 } while (cmpxchg(&gi->origin->u64.word[0], word, _word) != word); in gisa_get_ipm_or_restore_iam()
332 struct kvm_s390_gisa_interrupt *gi = &vcpu->kvm->arch.gisa_int; in pending_irqs() local
336 if (gi->origin) in pending_irqs()
337 pending_mask |= gisa_get_ipm(gi->origin) << IRQ_PEND_IO_ISC_7; in pending_irqs()
1166 struct kvm_s390_gisa_interrupt *gi = &vcpu->kvm->arch.gisa_int; in __deliver_io() local
1209 if (gi->origin && gisa_tac_ipm_gisc(gi->origin, isc)) { in __deliver_io()
1299 struct kvm_s390_gisa_interrupt *gi = &vcpu->kvm->arch.gisa_int; in kvm_s390_handle_wait() local
1313 if (gi->origin && in kvm_s390_handle_wait()
1314 (gisa_get_ipm_or_restore_iam(gi) & in kvm_s390_handle_wait()
1749 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in get_top_gisa_isc() local
1755 if (!gi->origin) in get_top_gisa_isc()
1758 active_mask = (isc_mask & gisa_get_ipm(gi->origin) << 24) << 32; in get_top_gisa_isc()
1761 if (gisa_tac_ipm_gisc(gi->origin, isc)) in get_top_gisa_isc()
1784 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_get_io_int() local
1802 gisa_set_ipm_gisc(gi->origin, isc); in kvm_s390_get_io_int()
1814 gisa_set_ipm_gisc(gi->origin, isc); in kvm_s390_get_io_int()
1905 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in __inject_io() local
1919 if (gi->origin && inti->type & KVM_S390_INT_IO_AI_MASK) { in __inject_io()
1921 gisa_set_ipm_gisc(gi->origin, isc); in __inject_io()
2252 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in get_all_floating_irqs() local
2276 if (gi->origin && gisa_get_ipm(gi->origin)) { in get_all_floating_irqs()
2283 if (gisa_tac_ipm_gisc(gi->origin, i)) { in get_all_floating_irqs()
3071 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in __airqs_kick_single_vcpu() local
3082 if (test_and_set_bit(vcpu_idx, gi->kicked_mask)) in __airqs_kick_single_vcpu()
3092 struct kvm_s390_gisa_interrupt *gi = in gisa_vcpu_kicker() local
3095 container_of(gi->origin, struct sie_page2, gisa)->kvm; in gisa_vcpu_kicker()
3098 pending_mask = gisa_get_ipm_or_restore_iam(gi); in gisa_vcpu_kicker()
3101 hrtimer_forward_now(timer, ns_to_ktime(gi->expires)); in gisa_vcpu_kicker()
3114 struct kvm_s390_gisa_interrupt *gi; in process_gib_alert_list() local
3148 gi = &kvm->arch.gisa_int; in process_gib_alert_list()
3149 if (hrtimer_active(&gi->timer)) in process_gib_alert_list()
3150 hrtimer_cancel(&gi->timer); in process_gib_alert_list()
3151 hrtimer_start(&gi->timer, 0, HRTIMER_MODE_REL); in process_gib_alert_list()
3159 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisa_clear() local
3161 if (!gi->origin) in kvm_s390_gisa_clear()
3163 gisa_clear_ipm(gi->origin); in kvm_s390_gisa_clear()
3164 VM_EVENT(kvm, 3, "gisa 0x%pK cleared", gi->origin); in kvm_s390_gisa_clear()
3169 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisa_init() local
3173 gi->origin = &kvm->arch.sie_page2->gisa; in kvm_s390_gisa_init()
3174 gi->alert.mask = 0; in kvm_s390_gisa_init()
3175 spin_lock_init(&gi->alert.ref_lock); in kvm_s390_gisa_init()
3176 gi->expires = 50 * 1000; /* 50 usec */ in kvm_s390_gisa_init()
3177 hrtimer_init(&gi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); in kvm_s390_gisa_init()
3178 gi->timer.function = gisa_vcpu_kicker; in kvm_s390_gisa_init()
3179 memset(gi->origin, 0, sizeof(struct kvm_s390_gisa)); in kvm_s390_gisa_init()
3180 gi->origin->next_alert = (u32)virt_to_phys(gi->origin); in kvm_s390_gisa_init()
3181 VM_EVENT(kvm, 3, "gisa 0x%pK initialized", gi->origin); in kvm_s390_gisa_init()
3186 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisa_enable() local
3191 if (gi->origin) in kvm_s390_gisa_enable()
3209 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisa_destroy() local
3210 struct kvm_s390_gisa *gisa = gi->origin; in kvm_s390_gisa_destroy()
3212 if (!gi->origin) in kvm_s390_gisa_destroy()
3214 WARN(gi->alert.mask != 0x00, in kvm_s390_gisa_destroy()
3216 gi->alert.mask); in kvm_s390_gisa_destroy()
3217 gi->alert.mask = 0x00; in kvm_s390_gisa_destroy()
3218 if (gisa_set_iam(gi->origin, gi->alert.mask)) in kvm_s390_gisa_destroy()
3220 hrtimer_cancel(&gi->timer); in kvm_s390_gisa_destroy()
3221 gi->origin = NULL; in kvm_s390_gisa_destroy()
3227 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisa_disable() local
3231 if (!gi->origin) in kvm_s390_gisa_disable()
3262 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisc_register() local
3264 if (!gi->origin) in kvm_s390_gisc_register()
3269 spin_lock(&gi->alert.ref_lock); in kvm_s390_gisc_register()
3270 gi->alert.ref_count[gisc]++; in kvm_s390_gisc_register()
3271 if (gi->alert.ref_count[gisc] == 1) { in kvm_s390_gisc_register()
3272 gi->alert.mask |= 0x80 >> gisc; in kvm_s390_gisc_register()
3273 gisa_set_iam(gi->origin, gi->alert.mask); in kvm_s390_gisc_register()
3275 spin_unlock(&gi->alert.ref_lock); in kvm_s390_gisc_register()
3301 struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; in kvm_s390_gisc_unregister() local
3304 if (!gi->origin) in kvm_s390_gisc_unregister()
3309 spin_lock(&gi->alert.ref_lock); in kvm_s390_gisc_unregister()
3310 if (gi->alert.ref_count[gisc] == 0) { in kvm_s390_gisc_unregister()
3314 gi->alert.ref_count[gisc]--; in kvm_s390_gisc_unregister()
3315 if (gi->alert.ref_count[gisc] == 0) { in kvm_s390_gisc_unregister()
3316 gi->alert.mask &= ~(0x80 >> gisc); in kvm_s390_gisc_unregister()
3317 gisa_set_iam(gi->origin, gi->alert.mask); in kvm_s390_gisc_unregister()
3320 spin_unlock(&gi->alert.ref_lock); in kvm_s390_gisc_unregister()
3328 struct kvm_s390_gisa_interrupt *gi; in aen_host_forward() local
3342 gi = &kvm->arch.gisa_int; in aen_host_forward()
3344 if (!(gi->origin->g1.simm & AIS_MODE_MASK(gaite->gisc)) || in aen_host_forward()
3345 !(gi->origin->g1.nimm & AIS_MODE_MASK(gaite->gisc))) { in aen_host_forward()
3346 gisa_set_ipm_gisc(gi->origin, gaite->gisc); in aen_host_forward()
3347 if (hrtimer_active(&gi->timer)) in aen_host_forward()
3348 hrtimer_cancel(&gi->timer); in aen_host_forward()
3349 hrtimer_start(&gi->timer, 0, HRTIMER_MODE_REL); in aen_host_forward()