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

Re: [PATCH] tools/xg: Reserialise CPU policies with the allocated number of leaves.



On Tue, Dec 12, 2023 at 10:57:17AM +0000, Alejandro Vallejo wrote:
> The procedure used to customize the domain CPU policy is broken when
> toolstack tries to set leaves (with subleaves) that the hypervisor didn't
> need to serialise (i.e: because they where empty subleaves).
> 
> During typical domain creation xg does the following:
> 
>   1. Probe Xen for max #leaves that a policy may have
>   2. Allocate memory for that many leaves
>   3. Tell the hypervisor to dump the policy in the allocated buffer
>   4. Deserialise it
>   5. Modify it
>   6. Reserialise it
>   7. Send it back to Xen
> 
> The problem is that (3) overrides nr_leaves, which then makes (6) fail in
> the case where (5) has added subleaves that Xen understands but didn't need
> to serialize on (3).
> 
> The fix uses an opaque CPU policy object so we can (a) avoid probing Xen
> for sizes, and (b) trivially have knowledge of the actual size of the
> buffer.
> 
> While at it, fix xc_cpu_policy_destroy() to preserve errno accross free()
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>

Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

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