/* Query where a cpu is now. Return codes #defined in plpar_wrappers.h */ int smp_query_cpu_stopped(unsignedint pcpu)
{ int cpu_status, status; int qcss_tok = rtas_function_token(RTAS_FN_QUERY_CPU_STOPPED_STATE);
if (qcss_tok == RTAS_UNKNOWN_SERVICE) {
printk_once(KERN_INFO "Firmware doesn't support query-cpu-stopped-state\n"); return QCSS_HARDWARE_ERROR;
}
if (cpumask_test_cpu(lcpu, of_spin_mask)) /* Already started by OF and sitting in spin loop */ return1;
pcpu = get_hard_smp_processor_id(lcpu);
/* Check to see if the CPU out of FW already for kexec */ if (smp_query_cpu_stopped(pcpu) == QCSS_NOT_STOPPED){
cpumask_set_cpu(lcpu, of_spin_mask); return1;
}
staticint pseries_smp_prepare_cpu(int cpu)
{ if (xive_enabled()) return xive_smp_prepare_cpu(cpu); return0;
}
/* Cause IPI as setup by the interrupt controller (xics or xive) */ staticvoid (*ic_cause_ipi)(int cpu) __ro_after_init;
/* Use msgsndp doorbells target is a sibling, else use interrupt controller */ staticvoid dbell_or_ic_cause_ipi(int cpu)
{ if (doorbell_try_core_ipi(cpu)) return;
ic_cause_ipi(cpu);
}
staticint pseries_cause_nmi_ipi(int cpu)
{ int hwcpu;
if (cpu == NMI_IPI_ALL_OTHERS) {
hwcpu = H_SIGNAL_SYS_RESET_ALL_OTHERS;
} else { if (cpu < 0) {
WARN_ONCE(true, "incorrect cpu parameter %d", cpu); return0;
}
hwcpu = get_hard_smp_processor_id(cpu);
}
if (plpar_signal_sys_reset(hwcpu) == H_SUCCESS) return1;
return0;
}
static __init void pSeries_smp_probe(void)
{ if (xive_enabled())
xive_smp_probe(); else
xics_smp_probe();
/* No doorbell facility, must use the interrupt controller for IPIs */ if (!cpu_has_feature(CPU_FTR_DBELL)) return;
/* Doorbells can only be used for IPIs between SMT siblings */ if (!cpu_has_feature(CPU_FTR_SMT)) return;
check_kvm_guest();
if (is_kvm_guest()) { /* *KVMemulatesdoorbellsbydisablingFSCR[MSGP]somsgsndp *faultstothehypervisorwhichthenreadstheinstruction *fromguestmemory,whichtendstobeslowerthanusingXIVE.
*/ if (xive_enabled()) return;
/* *XICShcallsaren'tasfast,sowecanusemsgsndp(which *alsohelpsexerciseKVMemulation),howeverKVMcan't *emulatesecureguestsbecauseitcan'treadtheinstruction *outoftheirmemory.
*/ if (is_secure_guest()) return;
}
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.