if ( v )
{
- if ( !d->is_pinned && !dom0_affinity_relaxed )
- cpumask_copy(v->cpu_hard_affinity, &dom0_cpus);
- cpumask_copy(v->cpu_soft_affinity, &dom0_cpus);
+ if ( pv_shim )
+ {
+
+ cpumask_setall(v->cpu_hard_affinity);
+ cpumask_setall(v->cpu_soft_affinity);
+ }
+ else
+ {
+ if ( !d->is_pinned && !dom0_affinity_relaxed )
+ cpumask_copy(v->cpu_hard_affinity, &dom0_cpus);
+ cpumask_copy(v->cpu_soft_affinity, &dom0_cpus);
+ }
}
return v;
unsigned int i, max_vcpus, limit;
nodeid_t node;
+ if ( pv_shim )
+ {
+ nodes_setall(dom0_nodes);
+
+ /*
+ * When booting in shim mode APs are not started until the guest brings
+ * other vCPUs up.
+ */
+ cpumask_set_cpu(0, &dom0_cpus);
+
+ /* On PV shim mode allow the guest to have as many CPUs as available. */
+ return nr_cpu_ids;
+ }
+
+
for ( i = 0; i < dom0_nr_pxms; ++i )
if ( (node = pxm_to_node(dom0_pxms[i])) != NUMA_NO_NODE )
node_set(node, dom0_nodes);
for ( i = 0; i < XEN_LEGACY_MAX_VCPUS; i++ )
shared_info(d, vcpu_info[i].evtchn_upcall_mask) = 1;
- printk("Dom0 has maximum %u VCPUs\n", d->max_vcpus);
+ printk("Dom%u has maximum %u VCPUs\n", d->domain_id, d->max_vcpus);
cpu = v->processor;
for ( i = 1; i < d->max_vcpus; i++ )
do_presmp_initcalls();
- for_each_present_cpu ( i )
+ /*
+ * NB: when running as a PV shim VCPUOP_up/down is wired to the shim
+ * physical cpu_add/remove functions, so launch the guest with only
+ * the BSP online and let it bring up the other CPUs as required.
+ */
+ if ( !pv_shim )
{
- /* Set up cpu_to_node[]. */
- srat_detect_node(i);
- /* Set up node_to_cpumask based on cpu_to_node[]. */
- numa_add_cpu(i);
-
- if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+ for_each_present_cpu ( i )
{
- int ret = cpu_up(i);
- if ( ret != 0 )
- printk("Failed to bring up CPU %u (error %d)\n", i, ret);
+ /* Set up cpu_to_node[]. */
+ srat_detect_node(i);
+ /* Set up node_to_cpumask based on cpu_to_node[]. */
+ numa_add_cpu(i);
+
+ if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+ {
+ int ret = cpu_up(i);
+ if ( ret != 0 )
+ printk("Failed to bring up CPU %u (error %d)\n", i, ret);
+ }
}
}