WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 2/6] trace: fix T_INFO_FIRST_OFFSET

>>> On 30.06.10 at 16:52, George Dunlap <George.Dunlap@xxxxxxxxxxxxx> wrote:
> Good catch.  This fix produces the correct index, but:
> * It's not as clear, IMHO, where the math is coming from
> * I think it may give the wrong result if the t_info struct ever
> changes (e.g., more data before the cpu offset list)

That part your patch doesn't address either - rather than
sizeof(uint16_t) as the first part of the expression you'd need to
use sizeof(struct t_info) or offsetof(struct t_info, mfn_offset).

Btw., didn't we agree that public headers shouldn't make use of
language extensions? struct t_info uses a variable sized array,
which is an extension (standard only in C99).

> The bug in the original math was that I should have added 3 to round
> up, rather than 1.

Correct.

> I'm attaching a patch that will hopefully fix the bug and make it more
> clear.  Thoughts?

Leaving aside the comment above this looks okay to me.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel