Lines Matching refs:xive

95 			if (kvmppc_xive_has_single_escalation(xc->xive))  in kvmppc_xive_native_cleanup_vcpu()
126 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_connect_vcpu() local
137 if (xive->kvm != vcpu->kvm) in kvmppc_xive_native_connect_vcpu()
142 mutex_lock(&xive->lock); in kvmppc_xive_native_connect_vcpu()
144 rc = kvmppc_xive_compute_vp_id(xive, server_num, &vp_id); in kvmppc_xive_native_connect_vcpu()
155 xc->xive = xive; in kvmppc_xive_native_connect_vcpu()
179 rc = xive_native_enable_vp(xc->vp_id, kvmppc_xive_has_single_escalation(xive)); in kvmppc_xive_native_connect_vcpu()
191 mutex_unlock(&xive->lock); in kvmppc_xive_native_connect_vcpu()
203 struct kvmppc_xive *xive = kvm->arch.xive; in kvmppc_xive_native_reset_mapped() local
215 mutex_lock(&xive->mapping_lock); in kvmppc_xive_native_reset_mapped()
216 if (xive->mapping) in kvmppc_xive_native_reset_mapped()
217 unmap_mapping_range(xive->mapping, in kvmppc_xive_native_reset_mapped()
220 mutex_unlock(&xive->mapping_lock); in kvmppc_xive_native_reset_mapped()
232 struct kvmppc_xive *xive = dev->private; in xive_native_esb_fault() local
249 sb = kvmppc_xive_find_source(xive, irq, &src); in xive_native_esb_fault()
312 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_mmap() local
335 xive->mapping = vma->vm_file->f_mapping; in kvmppc_xive_native_mmap()
339 static int kvmppc_xive_native_set_source(struct kvmppc_xive *xive, long irq, in kvmppc_xive_native_set_source() argument
354 sb = kvmppc_xive_find_source(xive, irq, &idx); in kvmppc_xive_native_set_source()
357 sb = kvmppc_xive_create_src_block(xive, irq); in kvmppc_xive_native_set_source()
405 xive->src_count++; in kvmppc_xive_native_set_source()
416 static int kvmppc_xive_native_update_source_config(struct kvmppc_xive *xive, in kvmppc_xive_native_update_source_config() argument
422 struct kvm *kvm = xive->kvm; in kvmppc_xive_native_update_source_config()
448 kvmppc_xive_vp(xive, server), in kvmppc_xive_native_update_source_config()
463 static int kvmppc_xive_native_set_source_config(struct kvmppc_xive *xive, in kvmppc_xive_native_set_source_config() argument
476 sb = kvmppc_xive_find_source(xive, irq, &src); in kvmppc_xive_native_set_source_config()
505 return kvmppc_xive_native_update_source_config(xive, sb, state, server, in kvmppc_xive_native_set_source_config()
509 static int kvmppc_xive_native_sync_source(struct kvmppc_xive *xive, in kvmppc_xive_native_sync_source() argument
521 sb = kvmppc_xive_find_source(xive, irq, &src); in kvmppc_xive_native_sync_source()
559 static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive, in kvmppc_xive_native_set_queue_config() argument
562 struct kvm *kvm = xive->kvm; in kvmppc_xive_native_set_queue_config()
700 kvmppc_xive_has_single_escalation(xive)); in kvmppc_xive_native_set_queue_config()
707 static int kvmppc_xive_native_get_queue_config(struct kvmppc_xive *xive, in kvmppc_xive_native_get_queue_config() argument
710 struct kvm *kvm = xive->kvm; in kvmppc_xive_native_get_queue_config()
805 static int kvmppc_xive_reset(struct kvmppc_xive *xive) in kvmppc_xive_reset() argument
807 struct kvm *kvm = xive->kvm; in kvmppc_xive_reset()
813 mutex_lock(&xive->lock); in kvmppc_xive_reset()
827 if (prio == 7 && kvmppc_xive_has_single_escalation(xive)) in kvmppc_xive_reset()
841 for (i = 0; i <= xive->max_sbid; i++) { in kvmppc_xive_reset()
842 struct kvmppc_xive_src_block *sb = xive->src_blocks[i]; in kvmppc_xive_reset()
851 mutex_unlock(&xive->lock); in kvmppc_xive_reset()
914 static int kvmppc_xive_native_eq_sync(struct kvmppc_xive *xive) in kvmppc_xive_native_eq_sync() argument
916 struct kvm *kvm = xive->kvm; in kvmppc_xive_native_eq_sync()
922 mutex_lock(&xive->lock); in kvmppc_xive_native_eq_sync()
923 for (i = 0; i <= xive->max_sbid; i++) { in kvmppc_xive_native_eq_sync()
924 struct kvmppc_xive_src_block *sb = xive->src_blocks[i]; in kvmppc_xive_native_eq_sync()
936 mutex_unlock(&xive->lock); in kvmppc_xive_native_eq_sync()
944 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_set_attr() local
950 return kvmppc_xive_reset(xive); in kvmppc_xive_native_set_attr()
952 return kvmppc_xive_native_eq_sync(xive); in kvmppc_xive_native_set_attr()
954 return kvmppc_xive_set_nr_servers(xive, attr->addr); in kvmppc_xive_native_set_attr()
958 return kvmppc_xive_native_set_source(xive, attr->attr, in kvmppc_xive_native_set_attr()
961 return kvmppc_xive_native_set_source_config(xive, attr->attr, in kvmppc_xive_native_set_attr()
964 return kvmppc_xive_native_set_queue_config(xive, attr->attr, in kvmppc_xive_native_set_attr()
967 return kvmppc_xive_native_sync_source(xive, attr->attr, in kvmppc_xive_native_set_attr()
976 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_get_attr() local
980 return kvmppc_xive_native_get_queue_config(xive, attr->attr, in kvmppc_xive_native_get_attr()
1016 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_release() local
1017 struct kvm *kvm = xive->kvm; in kvmppc_xive_native_release()
1027 mutex_lock(&xive->mapping_lock); in kvmppc_xive_native_release()
1028 xive->mapping = NULL; in kvmppc_xive_native_release()
1029 mutex_unlock(&xive->mapping_lock); in kvmppc_xive_native_release()
1041 debugfs_remove(xive->dentry); in kvmppc_xive_native_release()
1066 kvm->arch.xive = NULL; in kvmppc_xive_native_release()
1068 for (i = 0; i <= xive->max_sbid; i++) { in kvmppc_xive_native_release()
1069 if (xive->src_blocks[i]) in kvmppc_xive_native_release()
1070 kvmppc_xive_free_sources(xive->src_blocks[i]); in kvmppc_xive_native_release()
1071 kfree(xive->src_blocks[i]); in kvmppc_xive_native_release()
1072 xive->src_blocks[i] = NULL; in kvmppc_xive_native_release()
1075 if (xive->vp_base != XIVE_INVALID_VP) in kvmppc_xive_native_release()
1076 xive_native_free_vp_block(xive->vp_base); in kvmppc_xive_native_release()
1093 struct kvmppc_xive *xive; in kvmppc_xive_native_create() local
1098 if (kvm->arch.xive) in kvmppc_xive_native_create()
1101 xive = kvmppc_xive_get_device(kvm, type); in kvmppc_xive_native_create()
1102 if (!xive) in kvmppc_xive_native_create()
1105 dev->private = xive; in kvmppc_xive_native_create()
1106 xive->dev = dev; in kvmppc_xive_native_create()
1107 xive->kvm = kvm; in kvmppc_xive_native_create()
1108 mutex_init(&xive->mapping_lock); in kvmppc_xive_native_create()
1109 mutex_init(&xive->lock); in kvmppc_xive_native_create()
1112 xive->vp_base = XIVE_INVALID_VP; in kvmppc_xive_native_create()
1116 xive->nr_servers = KVM_MAX_VCPUS; in kvmppc_xive_native_create()
1119 xive->flags |= KVMPPC_XIVE_FLAG_SINGLE_ESCALATION; in kvmppc_xive_native_create()
1122 xive->flags |= KVMPPC_XIVE_FLAG_SAVE_RESTORE; in kvmppc_xive_native_create()
1124 xive->ops = &kvmppc_xive_native_ops; in kvmppc_xive_native_create()
1126 kvm->arch.xive = xive; in kvmppc_xive_native_create()
1177 struct kvmppc_xive *xive = vcpu->kvm->arch.xive; in kvmppc_xive_native_set_vp() local
1185 if (!xc || !xive) in kvmppc_xive_native_set_vp()
1213 struct kvmppc_xive *xive = m->private; in xive_native_debug_show() local
1214 struct kvm *kvm = xive->kvm; in xive_native_debug_show()
1244 for (i = 0; i <= xive->max_sbid; i++) { in xive_native_debug_show()
1245 struct kvmppc_xive_src_block *sb = xive->src_blocks[i]; in xive_native_debug_show()
1259 static void xive_native_debugfs_init(struct kvmppc_xive *xive) in xive_native_debugfs_init() argument
1261 xive->dentry = debugfs_create_file("xive", 0444, xive->kvm->debugfs_dentry, in xive_native_debugfs_init()
1262 xive, &xive_native_debug_fops); in xive_native_debugfs_init()
1269 struct kvmppc_xive *xive = dev->private; in kvmppc_xive_native_init() local
1272 xive_native_debugfs_init(xive); in kvmppc_xive_native_init()