Lines Matching refs:kvm
39 bool vgic_has_its(struct kvm *kvm) in vgic_has_its() argument
41 struct vgic_dist *dist = &kvm->arch.vgic; in vgic_has_its()
49 bool vgic_supports_direct_msis(struct kvm *kvm) in vgic_supports_direct_msis() argument
51 return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm); in vgic_supports_direct_msis()
64 struct vgic_dist *vgic = &vcpu->kvm->arch.vgic; in vgic_mmio_read_v3_misc()
76 if (vgic_has_its(vcpu->kvm)) { in vgic_mmio_read_v3_misc()
99 struct vgic_dist *dist = &vcpu->kvm->arch.vgic; in vgic_mmio_write_v3_misc()
107 vgic_kick_vcpus(vcpu->kvm); in vgic_mmio_write_v3_misc()
133 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, NULL, intid); in vgic_mmio_read_irouter()
143 vgic_put_irq(vcpu->kvm, irq); in vgic_mmio_read_irouter()
159 irq = vgic_get_irq(vcpu->kvm, NULL, intid); in vgic_mmio_write_irouter()
168 irq->target_vcpu = kvm_mpidr_to_vcpu(vcpu->kvm, irq->mpidr); in vgic_mmio_write_irouter()
171 vgic_put_irq(vcpu->kvm, irq); in vgic_mmio_write_irouter()
190 if (!vgic_has_its(vcpu->kvm)) in vgic_mmio_write_v3r_ctlr()
197 vgic_its_invalidate_cache(vcpu->kvm); in vgic_mmio_write_v3r_ctlr()
220 if (vgic_has_its(vcpu->kvm)) in vgic_mmio_read_v3r_typer()
236 if (vgic_has_its(vcpu->kvm)) in vgic_uaccess_read_v3r_typer()
276 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); in vgic_v3_uaccess_read_pending()
281 vgic_put_irq(vcpu->kvm, irq); in vgic_v3_uaccess_read_pending()
296 struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i); in vgic_v3_uaccess_write_pending()
306 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); in vgic_v3_uaccess_write_pending()
312 vgic_put_irq(vcpu->kvm, irq); in vgic_v3_uaccess_write_pending()
404 struct vgic_dist *dist = &vcpu->kvm->arch.vgic; in vgic_mmio_read_propbase()
413 struct vgic_dist *dist = &vcpu->kvm->arch.vgic; in vgic_mmio_write_propbase()
625 struct kvm *kvm = vcpu->kvm; in vgic_register_redist_iodev() local
626 struct vgic_dist *vgic = &kvm->arch.vgic; in vgic_register_redist_iodev()
646 if (!vgic_v3_check_base(kvm)) in vgic_register_redist_iodev()
660 mutex_lock(&kvm->slots_lock); in vgic_register_redist_iodev()
661 ret = kvm_io_bus_register_dev(kvm, KVM_MMIO_BUS, rd_base, in vgic_register_redist_iodev()
663 mutex_unlock(&kvm->slots_lock); in vgic_register_redist_iodev()
676 kvm_io_bus_unregister_dev(vcpu->kvm, KVM_MMIO_BUS, &rd_dev->dev); in vgic_unregister_redist_iodev()
679 static int vgic_register_all_redist_iodevs(struct kvm *kvm) in vgic_register_all_redist_iodevs() argument
684 kvm_for_each_vcpu(c, vcpu, kvm) { in vgic_register_all_redist_iodevs()
692 mutex_lock(&kvm->slots_lock); in vgic_register_all_redist_iodevs()
694 vcpu = kvm_get_vcpu(kvm, c); in vgic_register_all_redist_iodevs()
697 mutex_unlock(&kvm->slots_lock); in vgic_register_all_redist_iodevs()
718 static int vgic_v3_insert_redist_region(struct kvm *kvm, uint32_t index, in vgic_v3_insert_redist_region() argument
721 struct vgic_dist *d = &kvm->arch.vgic; in vgic_v3_insert_redist_region()
755 vgic_dist_overlap(kvm, base, size)) in vgic_v3_insert_redist_region()
759 if (vgic_v3_rdist_overlap(kvm, base, size)) in vgic_v3_insert_redist_region()
768 ret = vgic_check_ioaddr(kvm, &rdreg->base, base, SZ_64K); in vgic_v3_insert_redist_region()
784 int vgic_v3_set_redist_base(struct kvm *kvm, u32 index, u64 addr, u32 count) in vgic_v3_set_redist_base() argument
788 ret = vgic_v3_insert_redist_region(kvm, index, addr, count); in vgic_v3_set_redist_base()
796 ret = vgic_register_all_redist_iodevs(kvm); in vgic_v3_set_redist_base()
906 struct kvm *kvm = vcpu->kvm; in vgic_v3_dispatch_sgi() local
928 kvm_for_each_vcpu(c, c_vcpu, kvm) { in vgic_v3_dispatch_sgi()
950 irq = vgic_get_irq(vcpu->kvm, c_vcpu, sgi); in vgic_v3_dispatch_sgi()
961 vgic_queue_irq_unlock(vcpu->kvm, irq, flags); in vgic_v3_dispatch_sgi()
966 vgic_put_irq(vcpu->kvm, irq); in vgic_v3_dispatch_sgi()