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

Re: [Xen-devel] [PATCH v3 01/11] x86/domctl: Add XEN_DOMCTL_set_avail_vcpus



>>> On 21.11.16 at 22:00, <boris.ostrovsky@xxxxxxxxxx> wrote:
> This domctl is called when a VCPU is hot-(un)plugged to a guest (via
> 'xl vcpu-set').
> 
> The primary reason for adding this call is because for PVH guests
> the hypervisor needs to send an SCI and set GPE registers. This is
> unlike HVM guests that have qemu to perform these tasks.

And the tool stack can't do this?

> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -1157,6 +1157,31 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
> u_domctl)
>              copyback = 1;
>          break;
>  
> +    case XEN_DOMCTL_set_avail_vcpus:
> +    {
> +        unsigned int num = op->u.avail_vcpus.num;
> +        unsigned long *avail_vcpus;
> +
> +        if ( num > d->max_vcpus || num == 0 )
> +        {
> +            ret = -EINVAL;
> +            break;
> +        }
> +
> +        avail_vcpus = xzalloc_array(unsigned long, 
> BITS_TO_LONGS(d->max_vcpus));
> +        if ( !avail_vcpus )
> +        {
> +            ret = -ENOMEM;
> +            break;
> +        }
> +
> +        bitmap_fill(avail_vcpus, num);

What is the bitmap good for if all that gets ever set are the initial so
many bits? I think the domctl should _take_ a bitmap.

Also d->max_vcpus shouldn't change over the lifetime of the guest,
so repeated allocating and freeing the bitmap seems pointless.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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