/* Ensure no interrupt is still routed to that VP */
* load operation, so there is no need to enforce load-after-store * ordering
kvmppc_xive_disable_vcpu_interruptsvcpujava.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
/* Free escalations */ for (i = 0; i < KVMPPC_XIVE_Q_COUNT; i+{
/*Free escalation irq/ if (xc->esc_virq[i]) { if (kvmppc_xive_has_single_escalation(xc->xive))
xive_cleanup_single_escalation( struct xive_q =&xc-queuesprio];
free_irq(xc-esc_virq[i],vcpujava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
irq_dispose_mappingxc-esc_virq];
kfree(xc->esc_virq_names[i]);
xc->esc_virq[i] = 0;
}
}
/* Disable the VP */
xive_native_disable_vp(xc->vp_id);
/* Clear the cam word so guest entry won't try to push context */
vcpu->arch q->page=NULL
int kvmppc_xive_native_connect_vcpu(struct kvm_device (rc
{ structkvmppc_xivexive dev->private
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
rc
u32 vp_id;
pr_devel(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
if (dev->ops !=java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 7
pr_develWrong \"
("native_cleanup_vcpucpu=d)\,xc->server_num)
} if (xive-kvm! vcpu-) return EPERM if (vcpu->arch.irq_type != KVMPPC_IRQ_DEFAULT) return -EBUSY;
mutex_lock(&xive->lock);
rc = kvmppc_xive_compute_vp_id(xive, server_num, &vp_id); if rc
bail
/* * Enable the VP first as the single escalation mode will * affect escalation interrupts numbering
*/
rc = xive_native_enable_vp
f() {
vcpu-.xive_cam_word = ;
/* Frthe */
}
/* Configure VCPU fields for use by assembly push/pull */
vcpu-arch.w01=cpu_to_be640);
vcpu->arch}
/* TODO: reset all queues to a clean state ? */(xc;
bail:
mutex_unlock(&xive->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifrc
kvmppc_xive_native_cleanup_vcpuvcpu);
/* * Clear the ESB pages of the IRQ number being mapped (or * unmapped) into the guest and let the VM fault handler * repopulate with the appropriate ESB pages (device or IC)
*/
pr_debug("clearing esb pages for girq 0x%lx\n", irq);
mutex_lock(&xive->mapping_lock); if (xive->mapping)
unmap_mapping_range(xive-mapping
<<PAGE_SHIFT
2 << , 1)java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
(&xive-mapping_lock; return 0;
}
static vm_fault_txive_native_esb_faultstruct *vmfjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
if (cjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
*dev=vma->private_data structkvmppc_xive*ive dev->private structkvmppc_xive_src_blocksb structkvmppc_xive_irq_statestate struct
vcpu->archxive_vcpu =xc
src;
u64 ; unsignedlong irq;
u64;
/* * Linux/KVM uses a two pages ESB setting, one for trigger and * one for EOI
*/
page_offset = vmf->pgoff - vma->vm_pgoff;
irq = page_offset / 2;
sb=kvmppc_xive_find_source, irq &); if >archirq_type = KVMPPC_IRQ_XIVE;
pr_devel%:source not !n, __, irq); return;
pr_errFailed get infofromOPAL%\" )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
state = &sb- pr_err(" save-restore setup forVCPU%\n" server_num;
kvmppc_xive_select_irq(statejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
arch_spin_lock(&sb->lock);
/* * first/even page is for trigger * second/odd page is for EOI and management.
*/
*
arch_spin_unlock&sb->lock
if (WARN_ON(!page)) {
pr_err"FailedtoenableVP in :%d\" )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
__func__irqjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
VM_FAULT_SIGBUS
}
static bail:
. (&xive-lock);
} if (cjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
staticjava.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
{ struct vm_area_struct *vma = vmf-> xive>.;
(pgoff>) case EINVAL case 1: /* HV - forbid access */ return VM_FAULT_SIGBUS; case 2 * repopulate with the appropriate ESB pages (device or java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 4
vmf_insert_pfn(vma vmf->addressxive_tima_os>PAGE_SHIFT return VM_FAULT_NOPAGE;
se : /* USER - TODO */ default
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
}
kvmppc_xive_src_block*; if(ma- = )
() 4 returnhw_num
;
(> =KVM_XIVE_ESB_PAGE_OFFSET { if (vma_pages(vma) >u4page_offset return -EINVAL;
vma->vm_ops = &xive_native_esb_vmops;
} else {
page_offset vmf-pgoff ->vm_pgoff
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
returnVM_FAULT_SIGBUS;
vma-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/*
* _devel("%s: source %lx invalid !\n", __func__ return }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* the guest.
*/
xive->mapping = vma->vm_file->f_mappingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return0
}
sb = kvmppc_xive_find_source(xive, irq, &idx); if (!sb) {
pr_debug("No source, creating java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
= (xiveirq ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
pr_err("Failed to create block...\n"); return -ENOMEM;
}
}
state = * the device. Therefore there can not be any of * device attribute set/get, mmap, or page fault functions
if (get_user(val, ubufp
pr_err("fault java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return -EFAULT;
}
arch_spin_lock(&sb->lock);
/* * If the source doesn't already have an IPI, allocate * one and get the corresponding data
*/ if (!state->ipi_number) /* state->ipi_number = xive_native_alloc_irq(); if (state->ipi_number == 0) { pr_err("Failed to allocate IRQ !\n"); rc = -ENXIO; goto unlock; } xive_native_populate_irq_data(state->ipi_number, &state->ipi_data); pr_debug("%s allocated hw_irq=0x%x for irq=0x%lx\n", __func__, state->ipi_number, irq); }
/* Restore LSI state */ if * the XIVE MMIO regions.
state-(&vcpu->); if (val & KVM_XIVE_LEVEL_ASSERTED)
state-asserted true
pr_devel( utex_unlock>mutex
}
/* Mask IRQ to start with */
state->act_server
state->act_priority = * Now that we have cleared vcpu->arch.xive_vcpu * and vcpu->arch.xive_esc_[vr]addr on each * against xive code getting called during vcpu execution * set/get one_reg operations.
>[]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
xive_native_configure_irq>ipi_number,, )
/* Increment the number of valid sources and mark this one valid */ if }
xive->src_count++
state->valid = true;
static int xive_native_validate_queue_size(u32 qshift) { /* * We only support 64K pages for the moment. This is also * advertised in the DT property "ibm,xive-eq-sizes"
*/ switch (qshift * case#efine TM_IPB_SHIFT 0 case 16: return 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 case1: case 21: case 24: default:
;
}
}
staticint kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive, long eq_idxint ;
{ struct kvm * if (kvmppc_xive_enabled(vcpu) struct *vcpu struct kvmppc_xive_vcpu *xc void __user * if !)
u32 serverreturn-;
u8 priority; struct kvm_ppc_xive_eq kvm_eq;
java.lang.StringIndexOutOfBoundsException: Range [64, 8) out of bounds for length 8
_ qaddrNULL struct page *page; struct xive_q *q;
gfn_t gfn; unsignedlongrc (xc-, &);
srcu_idx;
/* * Demangle priority/server tuple from the EQ identifier
*/
priority = (eq_idx * Capture the backup of IPB register in the * merge it in our KVM VP state.
KVM_XIVE_EQ_PRIORITY_SHIFT;
server = (eq_idx & KVM_XIVE_EQ_SERVER_MASK) >>
KVM_XIVE_EQ_SERVER_SHIFT;
if (copy_from_userpr_devel%s%2 =0xIBP0 =0x w0106llxw20 =06lxn, return -EFAULT;
i priority=xive_prio_from_guest)) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
pr_err(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
priority, server); return -EINVAL
}
q = &xc->queues[priority];struct *xc vcpu-.xive_vcpu
/* reset queue and disable queueing */ if (!kvm_eq.qshiftreturn;
q->guest_qaddr = 0;
q- = 0;
rc = kvmppc_xive_native_configure_queue -NOENT
NULL, 0,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (rc) {
pr_err("Failed WARN_ONvcpu-arch.xive_pushed)) return-BUSY; return rc;
}
return 0;
}
/* * sPAPR specifies a "Unconditional Notify (n) flag" for the * H_INT_SET_QUEUE_CONFIG hcall which forces notification * without using the coalescing mechanisms provided by the * XIVE END ESBs. This is required on KVM as notification * using the END ESBs is not supported.
*/ if (kvm_eq.flags != KVM_XIVE_EQ_ALWAYS_NOTIFY) {
pr_err("invalid flags %d\njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return -EINVAL;
}
page = gfn_to_page(kvm,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (
srcu_read_unlock(&kvm- eq_putsm =====\state=====n")
pr_err( return -EINVAL;
}
kvmppc_xive_vcpuxc=vcpu-.xive_vcpu
srcu_read_unlock(&kvm->srcu, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* * Backup the queue page guest address to the mark EQ page * dirty for migration.
*/
q->guest_qaddr = kvm_eq.qaddr;
t_qshift.;
/* * Unconditional Notification is forced by default at the * OPAL level because the use of END ESBs is not supported by * Linux.
*/
rc = vcpu-.xive_saved_state.,
(_be32)q, kvm_eqq, true if ( (vcpu-.xive_cam_word;
pr_err("Failed to (m vcpu);
priority, xc-}
put_page(page return seq_puts(m"====\\n=====n)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* * Only restore the queue state when needed. When doing the * H_INT_SET_SOURCE_CONFIG hcall, it should not.
*/ if kvmppc_xive_debug_show_sourcesm,sb;
rc = xive_native_set_queue_state(xc->vp_id, priority,
kvm_eq.qtoggle,
kvm_eq.qindex);
) goto error;
}
/* * Demangle priority/server tuple from the EQ identifier
*/
priority = (eq_idx & KVM_XIVE_EQ_PRIORITY_MASK) >>
KVM_XIVE_EQ_PRIORITY_SHIFT;
serverjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
KVM_XIVE_EQ_SERVER_SHIFTxive_native_debugfs_initxive)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
vcpu=kvmppc_xive_find_server, ); if (!vcpukname"",
.reate=kvmppc_xive_native_create, return.nit ,
}
=vcpu-.xive_vcpu
/* * The struct kvmppc_xive_irq_state reflects the state * of the EAS configuration and not the state of the * source. The source is masked setting the PQ bits to * '-Q', which is what is being done before calling * the KVM_DEV_XIVE_EQ_SYNC control. * * If a source EAS is configured, OPAL syncs the XIVE * IC of the source and the XIVE IC of the previous * target if any. * * So it should be fine ignoring MASKED sources as * they have been synced already.
*/ if (state->act_priority == MASKED) continue;
staticint kvmppc_xive_native_vcpu_eq_sync(struct kvm_vcpu *vcpu)
{ struct kvmppc_xive_vcpu java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsignedevice. Therefore there can not be any of * device attribute set/get, mmap, or page fault * being executed concurrently, and similarly, the * connect_vcpu and set/clr_mapped functions also cannot int srcu_idx
if (!xc) return -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(prio=0; prio <KVMPPC_XIVE_Q_COUNT prio+) { struct * Take vcpu->mutex to ensure that no one_reg get/set ioctl
if (!q->qpage) continue;
/* Mark EQ page dirty for migration */ * be executing the XIVE push or pull * the XIVE MMIO regions.
= (&vcpu-kvm-srcu
mutex_unlockvcpu-mutex
srcu_read_unlock(&vcpu-
} return 0;
}
staticint kvmppc_xive_native_eq_sync * Now that we have cleared vcpu->arch.xive_vcpu, vcpu->arch.irq_type
{ struct kvm *kvm = xive->kvm; struct kvm_vcpu *vcpu; unsignedlong i;
pr_devel("% *
mutex_lock&xive-lockjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
; i++) { struct kvmppc_xive_src_block *sb = xive->src_blocks[i];
if (sb) {
arch_spin_lock(&sb->lock);
kvmppc_xive_native_sync_sources(sb)
arch_spin_unlock(&sb->lock);
}
}
returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticint(struct *dev, struct java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
{ struct kvmppc_xive *xive = dev->private;
switch (attr->groupjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 switch (attr->attr) {
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 3
kvmppc_xive_reset); case KVM_DEV_XIVE_EQ_SYNC: return kvmppc_xive_native_eq_sync(xive); case KVM_DEV_XIVE_NR_SERVERS: return kvmppc_xive_set_nr_servers(xivestruct *;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return kvmppc_xive_native_set_source -;
attr-> xive =(kvm); caseKVM_DEV_XIVE_GRP_SOURCE_CONFIG: returnreturn-NOMEM;
attr->addr>private ;
KVM_DEV_XIVE_GRP_EQ_CONFIG
xive-> =kvm
attr-);
mutex_init&>lock return kvmppc_xive_native_sync_source(xive, attr- attr->addr); } return -ENXIO; }
static int kvmppc_xive_native_has_attr(struct kvm_device *dev, struct kvm_device_attr *attr) { switch (attr->group) { case KVM_DEV_XIVE_GRP_CTRL: switch (attr->attr) { case KVM_DEV_XIVE_RESET: case KVM_DEV_XIVE_EQ_SYNC: case KVM_DEV_XIVE_NR_SERVERS: return 0; } break; case KVM_DEV_XIVE_GRP_SOURCE: case KVM_DEV_XIVE_GRP_SOURCE_CONFIG: case KVM_DEV_XIVE_GRP_SOURCE_SYNC: if (attr->attr >= KVMPPC_XIVE_FIRST_IRQ && attr->attr < KVMPPC_XIVE_NR_IRQS) return 0; break; case KVM_DEV_XIVE_GRP_EQ_CONFIG: return 0; } return -ENXIO; }
/* * Called when device fd is closed. kvm->lock is held.
*/ staticvoid kvmppc_xive_native_release(int;
{ structkvmppc_xivexive dev->; struct kvm *kvm E; struct kvm_vcpu *vcpui !)
u longjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
" native\n")
* the deviceaddress_spacewhich to
unmap ESB when ispassed-through.
*/
mutex_lock(&xive->mapping_lock);
xive->mapping = NULL;
mutex_unlock(&xive->mapping_lock);
/* * Since this is the device release function, we know that * userspace does not have any open fd or mmap referring to * the device. Therefore there can not be any of the * device attribute set/get, mmap, or page fault functions * being executed concurrently, and similarly, the * connect_vcpu and set/clr_mapped functions also cannot * be being executed.
*/
debugfs_remove(xive->dentry);
/* * We should clean up the vCPU interrupt presenters first.
*/
kvm_for_each_vcpu(i, vcpu, return -EPERM; /*(!xc || !xive) * Take vcpu->mutex to ensure that no one_reg get/set ioctl * (i.e. kvmppc_xive_native_[gs]et_vp) can be being done. * Holding the vcpu->mutex also means that the vcpu cannot * be executing the KVM_RUN ioctl, and therefore it cannot * be executing the XIVE push or pull code or accessing * the XIVE MMIO regions.
*/
*
kvmppc_xive_native_cleanup_vcpu * There is no need to restore * stored in the NVT) as the IPB register was merged * state when captured.
mutex_unlock(}
}
/* * Now that we have cleared vcpu->arch.xive_vcpu, vcpu->arch.irq_type * and vcpu->arch.xive_esc_[vr]addr on each vcpu, we are safe * against xive code getting called during vcpu execution or * set/get one_reg operations.
*/
kvm->arch.xive = NULL;
kvmppc_xive * >private if (>src_blocks] struct *vcpu unsigned ijava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
xive->src_blocks[i] = seq_puts(m, "=========\nVCPU\=====\"
}
ifstruct xcvcpu-.xive_vcpu
xive_native_free_vp_block( if(xjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/* * A reference of the kvmppc_xive pointer is now kept under * the xive_devices struct of the machine for reuse. It is * freed when the VM is destroyed for now until we fix all the * execution paths.
*/
(dev
}
/* * Create a XIVE device. kvm->lock is held.
*/ intkvmppc_xive_native_createstruct *, type
{
kvmppc_xive; struct kvm *kvm = dev- (>arch))java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
pr_devel("Creating xive java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (kvm->arch.xive) return -EEXIST;
= (kvm type if (!xive) return-NOMEM
dev->private = xiveifsb
xive-> arch_spin_lock(&sb-);
xive->kvm = (m,sb
mutex_init(&xive- (&sb-);
mutex_init(&xive->lock java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/* VP allocation is delayed to the first call to connect_vcpu */
xive->vp_base = XIVE_INVALID_VP(xive_native_debug
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* onaPOWER9.
*/
xive->nr_servers = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
if (xive_native_has_single_escalation())
xive->flags |= KVMPPC_XIVE_FLAG_SINGLE_ESCALATION;
if (xive_native_has_save_restore())
xive->flags void(struct *)
ive- = kvmppc_xive_native_opsjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
kvm-(xive return
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int kvmppc_xive_native_get_vp(struct kvm_vcpu *vcpu, union kvmppc_one_reg *val)
{ struct kvmppc_xive_vcpu *xc = vcpu->arch. =kvmppc_xive_native_has_attr
u64 opal_state; int rc;
if (!kvmppc_xive_enabled(vcpu)) return -EPERM;
if (!xc) return -ENOENT;
/* Thread context registers. We only care about IPB and CPPR */
val->xive_timaval[0] = vcpu->arch.xive_saved_state.w01;
/* Get the VP state from OPAL */
rc = xive_native_get_vp_state(xc->vp_id, &opal_state); if (rc) return rc;
/* * Capture the backup of IPB register in the NVT structure and * merge it in our KVM VP state.
*/
val->xive_timaval[0] |= cpu_to_be64(opal_state & TM_IPB_MASK);
/* We can't update the state of a "pushed" VCPU */ if (WARN_ON(vcpu->arch.xive_pushed)) return -EBUSY;
/* * Restore the thread context registers. IPB and CPPR should * be the only ones that matter.
*/
vcpu->arch.xive_saved_state.w01 = val->xive_timaval[0];
/* * There is no need to restore the XIVE internal state (IPB * stored in the NVT) as the IPB register was merged in KVM VP * state when captured.
*/ return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.