Lines Matching defs:xive

6 #define pr_fmt(fmt) "xive-kvm: " fmt
19 #include <asm/xive.h>
20 #include <asm/xive-regs.h>
98 if (xc->xive->single_escalation)
130 struct kvmppc_xive *xive = dev->private;
141 if (xive->kvm != vcpu->kvm)
146 mutex_lock(&xive->lock);
148 rc = kvmppc_xive_compute_vp_id(xive, server_num, &vp_id);
159 xc->xive = xive;
177 rc = xive_native_enable_vp(xc->vp_id, xive->single_escalation);
189 mutex_unlock(&xive->lock);
201 struct kvmppc_xive *xive = kvm->arch.xive;
213 mutex_lock(&xive->mapping_lock);
214 if (xive->mapping)
215 unmap_mapping_range(xive->mapping,
218 mutex_unlock(&xive->mapping_lock);
230 struct kvmppc_xive *xive = dev->private;
247 sb = kvmppc_xive_find_source(xive, irq, &src);
310 struct kvmppc_xive *xive = dev->private;
333 xive->mapping = vma->vm_file->f_mapping;
337 static int kvmppc_xive_native_set_source(struct kvmppc_xive *xive, long irq,
352 sb = kvmppc_xive_find_source(xive, irq, &idx);
355 sb = kvmppc_xive_create_src_block(xive, irq);
403 xive->src_count++;
414 static int kvmppc_xive_native_update_source_config(struct kvmppc_xive *xive,
420 struct kvm *kvm = xive->kvm;
446 kvmppc_xive_vp(xive, server),
461 static int kvmppc_xive_native_set_source_config(struct kvmppc_xive *xive,
474 sb = kvmppc_xive_find_source(xive, irq, &src);
503 return kvmppc_xive_native_update_source_config(xive, sb, state, server,
507 static int kvmppc_xive_native_sync_source(struct kvmppc_xive *xive,
519 sb = kvmppc_xive_find_source(xive, irq, &src);
543 * advertised in the DT property "ibm,xive-eq-sizes"
557 static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
560 struct kvm *kvm = xive->kvm;
698 xive->single_escalation);
705 static int kvmppc_xive_native_get_queue_config(struct kvmppc_xive *xive,
708 struct kvm *kvm = xive->kvm;
803 static int kvmppc_xive_reset(struct kvmppc_xive *xive)
805 struct kvm *kvm = xive->kvm;
811 mutex_lock(&xive->lock);
825 if (prio == 7 && xive->single_escalation)
839 for (i = 0; i <= xive->max_sbid; i++) {
840 struct kvmppc_xive_src_block *sb = xive->src_blocks[i];
849 mutex_unlock(&xive->lock);
912 static int kvmppc_xive_native_eq_sync(struct kvmppc_xive *xive)
914 struct kvm *kvm = xive->kvm;
920 mutex_lock(&xive->lock);
921 for (i = 0; i <= xive->max_sbid; i++) {
922 struct kvmppc_xive_src_block *sb = xive->src_blocks[i];
934 mutex_unlock(&xive->lock);
942 struct kvmppc_xive *xive = dev->private;
948 return kvmppc_xive_reset(xive);
950 return kvmppc_xive_native_eq_sync(xive);
952 return kvmppc_xive_set_nr_servers(xive, attr->addr);
956 return kvmppc_xive_native_set_source(xive, attr->attr,
959 return kvmppc_xive_native_set_source_config(xive, attr->attr,
962 return kvmppc_xive_native_set_queue_config(xive, attr->attr,
965 return kvmppc_xive_native_sync_source(xive, attr->attr,
974 struct kvmppc_xive *xive = dev->private;
978 return kvmppc_xive_native_get_queue_config(xive, attr->attr,
1014 struct kvmppc_xive *xive = dev->private;
1015 struct kvm *kvm = xive->kvm;
1019 pr_devel("Releasing xive native device\n");
1025 mutex_lock(&xive->mapping_lock);
1026 xive->mapping = NULL;
1027 mutex_unlock(&xive->mapping_lock);
1039 debugfs_remove(xive->dentry);
1061 * against xive code getting called during vcpu execution or
1064 kvm->arch.xive = NULL;
1066 for (i = 0; i <= xive->max_sbid; i++) {
1067 if (xive->src_blocks[i])
1068 kvmppc_xive_free_sources(xive->src_blocks[i]);
1069 kfree(xive->src_blocks[i]);
1070 xive->src_blocks[i] = NULL;
1073 if (xive->vp_base != XIVE_INVALID_VP)
1074 xive_native_free_vp_block(xive->vp_base);
1091 struct kvmppc_xive *xive;
1094 pr_devel("Creating xive native device\n");
1096 if (kvm->arch.xive)
1099 xive = kvmppc_xive_get_device(kvm, type);
1100 if (!xive)
1103 dev->private = xive;
1104 xive->dev = dev;
1105 xive->kvm = kvm;
1106 mutex_init(&xive->mapping_lock);
1107 mutex_init(&xive->lock);
1110 xive->vp_base = XIVE_INVALID_VP;
1114 xive->nr_servers = KVM_MAX_VCPUS;
1116 xive->single_escalation = xive_native_has_single_escalation();
1117 xive->ops = &kvmppc_xive_native_ops;
1119 kvm->arch.xive = xive;
1170 struct kvmppc_xive *xive = vcpu->kvm->arch.xive;
1178 if (!xc || !xive)
1206 struct kvmppc_xive *xive = m->private;
1207 struct kvm *kvm = xive->kvm;
1239 static void xive_native_debugfs_init(struct kvmppc_xive *xive)
1243 name = kasprintf(GFP_KERNEL, "kvm-xive-%p", xive);
1249 xive->dentry = debugfs_create_file(name, 0444, powerpc_debugfs_root,
1250 xive, &xive_native_debug_fops);
1258 struct kvmppc_xive *xive = (struct kvmppc_xive *)dev->private;
1261 xive_native_debugfs_init(xive);
1265 .name = "kvm-xive-native",