MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xenpv_probe_cpus

Function xenpv_probe_cpus

freebsd/x86/xen/pvcpu_enum.c:151–165  ·  view source on GitHub ↗

* Test each possible vCPU in order to find the number of vCPUs */

Source from the content-addressed store, hash-verified

149 * Test each possible vCPU in order to find the number of vCPUs
150 */
151static int
152xenpv_probe_cpus(void)
153{
154#ifdef SMP
155 int i, ret;
156
157 for (i = 0; i < MAXCPU && (i * 2) < MAX_APIC_ID; i++) {
158 ret = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
159 mp_ncpus = min(mp_ncpus + 1, MAXCPU);
160 }
161 mp_maxid = mp_ncpus - 1;
162 max_apic_id = mp_ncpus * 2;
163#endif
164 return (0);
165}
166
167/*
168 * Initialize the vCPU id of the BSP

Callers

nothing calls this directly

Calls 2

HYPERVISOR_vcpu_opFunction · 0.85
minFunction · 0.85

Tested by

no test coverage detected