Lines Matching refs:rdreg
296 struct vgic_redist_region *iter, *rdreg = vgic_cpu->rdreg; in vgic_mmio_vcpu_rdist_is_last() local
298 if (!rdreg) in vgic_mmio_vcpu_rdist_is_last()
301 if (vgic_cpu->rdreg_index < rdreg->free_index - 1) { in vgic_mmio_vcpu_rdist_is_last()
303 } else if (rdreg->count && vgic_cpu->rdreg_index == (rdreg->count - 1)) { in vgic_mmio_vcpu_rdist_is_last()
305 gpa_t end = rdreg->base + rdreg->count * KVM_VGIC_V3_REDIST_SIZE; in vgic_mmio_vcpu_rdist_is_last()
770 struct vgic_redist_region *rdreg; in vgic_register_redist_iodev() local
783 rdreg = vgic_v3_rdist_free_slot(&vgic->rd_regions); in vgic_register_redist_iodev()
784 if (!rdreg) in vgic_register_redist_iodev()
790 vgic_cpu->rdreg = rdreg; in vgic_register_redist_iodev()
791 vgic_cpu->rdreg_index = rdreg->free_index; in vgic_register_redist_iodev()
793 rd_base = rdreg->base + rdreg->free_index * KVM_VGIC_V3_REDIST_SIZE; in vgic_register_redist_iodev()
810 rdreg->free_index++; in vgic_register_redist_iodev()
867 struct vgic_redist_region *rdreg; in vgic_v3_alloc_redist_region() local
882 rdreg = list_last_entry(rd_regions, in vgic_v3_alloc_redist_region()
886 if (!count && rdreg->count) in vgic_v3_alloc_redist_region()
892 if (index != rdreg->index + 1) in vgic_v3_alloc_redist_region()
909 rdreg = kzalloc(sizeof(*rdreg), GFP_KERNEL_ACCOUNT); in vgic_v3_alloc_redist_region()
910 if (!rdreg) in vgic_v3_alloc_redist_region()
913 rdreg->base = VGIC_ADDR_UNDEF; in vgic_v3_alloc_redist_region()
915 ret = vgic_check_iorange(kvm, rdreg->base, base, SZ_64K, size); in vgic_v3_alloc_redist_region()
919 rdreg->base = base; in vgic_v3_alloc_redist_region()
920 rdreg->count = count; in vgic_v3_alloc_redist_region()
921 rdreg->free_index = 0; in vgic_v3_alloc_redist_region()
922 rdreg->index = index; in vgic_v3_alloc_redist_region()
924 list_add_tail(&rdreg->list, rd_regions); in vgic_v3_alloc_redist_region()
927 kfree(rdreg); in vgic_v3_alloc_redist_region()
931 void vgic_v3_free_redist_region(struct vgic_redist_region *rdreg) in vgic_v3_free_redist_region() argument
933 list_del(&rdreg->list); in vgic_v3_free_redist_region()
934 kfree(rdreg); in vgic_v3_free_redist_region()
951 struct vgic_redist_region *rdreg; in vgic_v3_set_redist_base() local
953 rdreg = vgic_v3_rdist_region_from_index(kvm, index); in vgic_v3_set_redist_base()
954 vgic_v3_free_redist_region(rdreg); in vgic_v3_set_redist_base()