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

Re: [Xen-devel] [PATCH] libxl: fix "xl mem-set" regression from 0c029c4da2



>>> On 22.04.15 at 15:57, <stefano.stabellini@xxxxxxxxxxxxx> wrote:
> From the description of the problem above, we have two issues:
> 
> 1) we don't detect that maxmem is already UINT_MAX*4, so we shouldn't try
>    to increase it
> 
> 2) unsigned int / uint64_t mismatch
> 
> 
> 1) is pretty easy and might just come down to one more if statement in
> libxl_set_memory_target. Something like:
> 
> 
> #define MAXMEM_MAX_KB ((uint64_t)UINT32_MAX * 4)
> if ((new_target_memkb - current_target_memkb) > 0 && 
>     (ptr.max_memkb - new_target_memkb + current_target_memkb) < ptr.max_memkb)
> {
>     /* avoid overflow */
>    rc = xc_domain_setmaxmem(ctx->xch, domid, MAXMEM_MAX_KB);
> } else {
>    rc = xc_domain_setmaxmem(ctx->xch, domid, memorykb);
> }

Which would build into the tool stack an assumption that the
hypervisor representation is a 32-bit value worth of pages. Not
really desirable imo. If anything we'd need to do actual overflow
checking (and saturation, similar to what the hypervisor patch
does) here too.

> 2) is difficult as we have unsigned int in many many places.  Not only
> we need to fix the libxc interface, but as far as I can tell we also
> need to fix at least libxl_set_memory_target,
> libxl__fill_dom0_memory_info, libxl__get_memory_target, all the callers.
> This is the minimum set of changes I think are required:

I'll leave that to the tool stack maintainers to decide upon. All I
really need immediately is that "xl mem-set" works again.

Jan


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


 


Rackspace

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