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

Re: [PATCH] tools: ROUNDUP() related adjustments



Juergen Gross writes ("Re: [PATCH] tools: ROUNDUP() related adjustments"):
> On 10.08.21 12:03, Jan Beulich wrote:
> > For one xc_private.h needlessly repeats xen-tools/libs.h's definition.
> > 
> > And then there are two suspicious uses (resulting from the inconsistency
> > with the respective 2nd parameter of DIV_ROUNDUP()): While the one in
> > tools/console/daemon/io.c - as per the code comment - intentionally uses
> > 8 as the second argument (meaning to align to a multiple of 256), the
> > one in alloc_magic_pages_hvm() pretty certainly does not: There the goal
> > is to align to a uint64_t boundary, for the following module struct to
> > end up aligned.

This is really quite unpleasnt, to my mind.  ROUNDUP taking a bit
length is bad enough, but the magic knowledge about alignment is
really poor too.  It may not be right on all future architectures,
although I think your changae is correct on all the ones we support
(or which people are working on).

So IOW I think your change is correct and warranted, but I really
dislike the code here.

Therefore:

Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>

> > Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Reviewed-by: Juergen Gross <jgross@xxxxxxxx>

Thanks for the review!

Ian.



 


Rackspace

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