Lines Matching full:vgpu
70 static void update_upstream_irq(struct intel_vgpu *vgpu,
182 * @vgpu: a vGPU
194 int intel_vgpu_reg_imr_handler(struct intel_vgpu *vgpu, in intel_vgpu_reg_imr_handler() argument
197 struct intel_gvt *gvt = vgpu->gvt; in intel_vgpu_reg_imr_handler()
201 trace_write_ir(vgpu->id, "IMR", reg, imr, vgpu_vreg(vgpu, reg), in intel_vgpu_reg_imr_handler()
202 (vgpu_vreg(vgpu, reg) ^ imr)); in intel_vgpu_reg_imr_handler()
204 vgpu_vreg(vgpu, reg) = imr; in intel_vgpu_reg_imr_handler()
206 ops->check_pending_irq(vgpu); in intel_vgpu_reg_imr_handler()
213 * @vgpu: a vGPU
224 int intel_vgpu_reg_master_irq_handler(struct intel_vgpu *vgpu, in intel_vgpu_reg_master_irq_handler() argument
227 struct intel_gvt *gvt = vgpu->gvt; in intel_vgpu_reg_master_irq_handler()
230 u32 virtual_ier = vgpu_vreg(vgpu, reg); in intel_vgpu_reg_master_irq_handler()
232 trace_write_ir(vgpu->id, "MASTER_IRQ", reg, ier, virtual_ier, in intel_vgpu_reg_master_irq_handler()
242 vgpu_vreg(vgpu, reg) &= ~GEN8_MASTER_IRQ_CONTROL; in intel_vgpu_reg_master_irq_handler()
243 vgpu_vreg(vgpu, reg) |= ier; in intel_vgpu_reg_master_irq_handler()
245 ops->check_pending_irq(vgpu); in intel_vgpu_reg_master_irq_handler()
252 * @vgpu: a vGPU
263 int intel_vgpu_reg_ier_handler(struct intel_vgpu *vgpu, in intel_vgpu_reg_ier_handler() argument
266 struct intel_gvt *gvt = vgpu->gvt; in intel_vgpu_reg_ier_handler()
272 trace_write_ir(vgpu->id, "IER", reg, ier, vgpu_vreg(vgpu, reg), in intel_vgpu_reg_ier_handler()
273 (vgpu_vreg(vgpu, reg) ^ ier)); in intel_vgpu_reg_ier_handler()
275 vgpu_vreg(vgpu, reg) = ier; in intel_vgpu_reg_ier_handler()
282 update_upstream_irq(vgpu, info); in intel_vgpu_reg_ier_handler()
284 ops->check_pending_irq(vgpu); in intel_vgpu_reg_ier_handler()
291 * @vgpu: a vGPU
302 int intel_vgpu_reg_iir_handler(struct intel_vgpu *vgpu, unsigned int reg, in intel_vgpu_reg_iir_handler() argument
305 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in intel_vgpu_reg_iir_handler()
306 struct intel_gvt_irq_info *info = regbase_to_irq_info(vgpu->gvt, in intel_vgpu_reg_iir_handler()
310 trace_write_ir(vgpu->id, "IIR", reg, iir, vgpu_vreg(vgpu, reg), in intel_vgpu_reg_iir_handler()
311 (vgpu_vreg(vgpu, reg) ^ iir)); in intel_vgpu_reg_iir_handler()
316 vgpu_vreg(vgpu, reg) &= ~iir; in intel_vgpu_reg_iir_handler()
319 update_upstream_irq(vgpu, info); in intel_vgpu_reg_iir_handler()
340 static void update_upstream_irq(struct intel_vgpu *vgpu, in update_upstream_irq() argument
343 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in update_upstream_irq()
344 struct intel_gvt_irq *irq = &vgpu->gvt->irq; in update_upstream_irq()
350 u32 val = vgpu_vreg(vgpu, in update_upstream_irq()
352 & vgpu_vreg(vgpu, in update_upstream_irq()
382 vgpu_vreg(vgpu, isr) &= ~clear_bits; in update_upstream_irq()
383 vgpu_vreg(vgpu, isr) |= set_bits; in update_upstream_irq()
390 vgpu_vreg(vgpu, iir) |= (set_bits & ~vgpu_vreg(vgpu, imr)); in update_upstream_irq()
394 update_upstream_irq(vgpu, up_irq_info); in update_upstream_irq()
424 static void inject_virtual_interrupt(struct intel_vgpu *vgpu) in inject_virtual_interrupt() argument
426 unsigned long offset = vgpu->gvt->device_info.msi_cap_offset; in inject_virtual_interrupt()
430 control = *(u16 *)(vgpu_cfg_space(vgpu) + MSI_CAP_CONTROL(offset)); in inject_virtual_interrupt()
431 addr = *(u32 *)(vgpu_cfg_space(vgpu) + MSI_CAP_ADDRESS(offset)); in inject_virtual_interrupt()
432 data = *(u16 *)(vgpu_cfg_space(vgpu) + MSI_CAP_DATA(offset)); in inject_virtual_interrupt()
441 trace_inject_msi(vgpu->id, addr, data); in inject_virtual_interrupt()
444 * When guest is powered off, msi_trigger is set to NULL, but vgpu's in inject_virtual_interrupt()
446 * poweroff. If this vgpu is still used in next vm, this vgpu's pipe in inject_virtual_interrupt()
447 * may be enabled, then once this vgpu is active, it will get inject in inject_virtual_interrupt()
452 if (!test_bit(INTEL_VGPU_STATUS_ATTACHED, vgpu->status)) in inject_virtual_interrupt()
454 if (vgpu->msi_trigger) in inject_virtual_interrupt()
455 eventfd_signal(vgpu->msi_trigger); in inject_virtual_interrupt()
459 enum intel_gvt_event_type event, struct intel_vgpu *vgpu) in propagate_event() argument
472 if (!test_bit(bit, (void *)&vgpu_vreg(vgpu, in propagate_event()
474 trace_propagate_event(vgpu->id, irq_name[event], bit); in propagate_event()
475 set_bit(bit, (void *)&vgpu_vreg(vgpu, in propagate_event()
482 enum intel_gvt_event_type event, struct intel_vgpu *vgpu) in handle_default_event_virt() argument
484 if (!vgpu->irq.irq_warn_once[event]) { in handle_default_event_virt()
485 gvt_dbg_core("vgpu%d: IRQ receive event %d (%s)\n", in handle_default_event_virt()
486 vgpu->id, event, irq_name[event]); in handle_default_event_virt()
487 vgpu->irq.irq_warn_once[event] = true; in handle_default_event_virt()
489 propagate_event(irq, event, vgpu); in handle_default_event_virt()
522 static void gen8_check_pending_irq(struct intel_vgpu *vgpu) in gen8_check_pending_irq() argument
524 struct intel_gvt_irq *irq = &vgpu->gvt->irq; in gen8_check_pending_irq()
527 if (!(vgpu_vreg(vgpu, i915_mmio_reg_offset(GEN8_MASTER_IRQ)) & in gen8_check_pending_irq()
539 if ((vgpu_vreg(vgpu, regbase_to_iir(reg_base)) in gen8_check_pending_irq()
540 & vgpu_vreg(vgpu, regbase_to_ier(reg_base)))) in gen8_check_pending_irq()
541 update_upstream_irq(vgpu, info); in gen8_check_pending_irq()
544 if (vgpu_vreg(vgpu, i915_mmio_reg_offset(GEN8_MASTER_IRQ)) in gen8_check_pending_irq()
546 inject_virtual_interrupt(vgpu); in gen8_check_pending_irq()
667 * intel_vgpu_trigger_virtual_event - Trigger a virtual event for a vGPU
668 * @vgpu: a vGPU
671 * This function is used to trigger a virtual interrupt event for vGPU.
676 void intel_vgpu_trigger_virtual_event(struct intel_vgpu *vgpu, in intel_vgpu_trigger_virtual_event() argument
679 struct drm_i915_private *i915 = vgpu->gvt->gt->i915; in intel_vgpu_trigger_virtual_event()
680 struct intel_gvt *gvt = vgpu->gvt; in intel_vgpu_trigger_virtual_event()
688 handler(irq, event, vgpu); in intel_vgpu_trigger_virtual_event()
690 ops->check_pending_irq(vgpu); in intel_vgpu_trigger_virtual_event()