[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 12/20] xen/domctl: Merge max_vcpus into createdomain



>>> On 19.03.18 at 20:13, <andrew.cooper3@xxxxxxxxxx> wrote:
> @@ -551,6 +555,37 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>          if ( !ret )
>              goto createdomain_fail_late;
>  
> +        ret = -EINVAL;
> +        if ( vcpus > domain_max_vcpus(d) )
> +            goto createdomain_fail_late;
> +
> +        ret = -ENOMEM;
> +        online = cpupool_domain_cpumask(d);
> +
> +        BUG_ON(d->vcpu);
> +        BUG_ON(d->max_vcpus);
> +
> +        d->vcpu = xzalloc_array(struct vcpu *, vcpus);
> +        /* Install vcpu array /then/ update max_vcpus. */
> +        smp_wmb();
> +        if ( !d->vcpu )
> +            goto createdomain_fail_late;
> +        d->max_vcpus = vcpus;
> +
> +        cpu = cpumask_any(online);
> +        for ( i = 0; i < vcpus; ++i )
> +        {
> +            BUG_ON(d->vcpu[i]);
> +
> +            if ( alloc_vcpu(d, i, cpu) == NULL )
> +                goto createdomain_fail_late;
> +
> +            BUG_ON(!d->vcpu[i]);
> +
> +            cpu = cpumask_cycle(d->vcpu[i]->processor, online);
> +        }
> +
> +        ret = 0;
>          d = NULL;
>          break;

Same question here regarding the late placement. Additionally, by
doing this after insertion onto the list, you still leave a window
where the domain can be found but has a NULL vcpus pointer.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.