Lines Matching +full:msi +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
22 unsigned int spi_id = e->irqchip.pin + VGIC_NR_PRIVATE_IRQS; in vgic_irqfd_set_irq()
25 return -EINVAL; in vgic_irqfd_set_irq()
36 * return 0 on success, -EINVAL on errors.
42 int r = -EINVAL; in kvm_set_routing_entry()
44 switch (ue->type) { in kvm_set_routing_entry()
46 e->set = vgic_irqfd_set_irq; in kvm_set_routing_entry()
47 e->irqchip.irqchip = ue->u.irqchip.irqchip; in kvm_set_routing_entry()
48 e->irqchip.pin = ue->u.irqchip.pin; in kvm_set_routing_entry()
49 if ((e->irqchip.pin >= KVM_IRQCHIP_NUM_PINS) || in kvm_set_routing_entry()
50 (e->irqchip.irqchip >= KVM_NR_IRQCHIPS)) in kvm_set_routing_entry()
54 e->set = kvm_set_msi; in kvm_set_routing_entry()
55 e->msi.address_lo = ue->u.msi.address_lo; in kvm_set_routing_entry()
56 e->msi.address_hi = ue->u.msi.address_hi; in kvm_set_routing_entry()
57 e->msi.data = ue->u.msi.data; in kvm_set_routing_entry()
58 e->msi.flags = ue->flags; in kvm_set_routing_entry()
59 e->msi.devid = ue->u.msi.devid; in kvm_set_routing_entry()
70 struct kvm_msi *msi) in kvm_populate_msi() argument
72 msi->address_lo = e->msi.address_lo; in kvm_populate_msi()
73 msi->address_hi = e->msi.address_hi; in kvm_populate_msi()
74 msi->data = e->msi.data; in kvm_populate_msi()
75 msi->flags = e->msi.flags; in kvm_populate_msi()
76 msi->devid = e->msi.devid; in kvm_populate_msi()
80 * kvm_set_msi: inject the MSI corresponding to the
81 * MSI routing entry
83 * This is the entry point for irqfd MSI injection
84 * and userspace MSI injection.
90 struct kvm_msi msi; in kvm_set_msi() local
93 return -ENODEV; in kvm_set_msi()
96 return -1; in kvm_set_msi()
98 kvm_populate_msi(e, &msi); in kvm_set_msi()
99 return vgic_its_inject_msi(kvm, &msi); in kvm_set_msi()
103 * kvm_arch_set_irq_inatomic: fast-path for irqfd injection
110 return -EWOULDBLOCK; in kvm_arch_set_irq_inatomic()
112 switch (e->type) { in kvm_arch_set_irq_inatomic()
114 struct kvm_msi msi; in kvm_arch_set_irq_inatomic() local
119 kvm_populate_msi(e, &msi); in kvm_arch_set_irq_inatomic()
120 return vgic_its_inject_cached_translation(kvm, &msi); in kvm_arch_set_irq_inatomic()
130 return vgic_irqfd_set_irq(e, kvm, irq_source_id, 1, line_status); in kvm_arch_set_irq_inatomic()
133 return -EWOULDBLOCK; in kvm_arch_set_irq_inatomic()
139 struct vgic_dist *dist = &kvm->arch.vgic; in kvm_vgic_setup_default_irq_routing()
140 u32 nr = dist->nr_spis; in kvm_vgic_setup_default_irq_routing()
145 return -ENOMEM; in kvm_vgic_setup_default_irq_routing()