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/
Home Products Support Community News


RE: [Xen-devel] Need help figuring out why my windows pv driverswontwork

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Need help figuring out why my windows pv driverswontwork with a 32 bit dom0...
From: Daniel Stodden <stodden@xxxxxxxxxx>
Date: Fri, 01 Feb 2008 13:59:05 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 01 Feb 2008 04:59:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D0131AA18@trantor>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Fakultät für Informatik I10, Technische Universität München
References: <AEC6C66638C05B468B556EA548C1A77D0131AA0A@trantor> <AEC6C66638C05B468B556EA548C1A77D0131AA0E@trantor> <AEC6C66638C05B468B556EA548C1A77D0131AA18@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2008-02-01 at 16:48 +1100, James Harper wrote:

> "#pragma pack(4)" before the blkif definitions and "#pragma pack()"
> afterwards fixed it up.

yes, packing should fix it, but is it the right approach?
the fields are not naturally (i.e. multiple of the word size) aligned,
and that is the problem. different compilers will chose alignments
different from the declared ones for good reason. The 64bit values are
hanging across a dword boundary, and expect the memory interface to hate

could you add explicit, sane pad values to the structures and see
whether that negatively affects the message sizes which fit on the
sring? I don't think that this would be the case. Pad, _then_ pack them.
Should be packed for gcc as well, as there are no guarantees that chosen
alignments are maintained across past and future revisions:

btw: there's an offsetof() macro (C99?) which should give you more
insight which variables are actually affected in your test code:
#define offsetof(type,memb) ((unsigned long) &((type*)0)->memb)


Daniel Stodden
LRR     -      Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU München             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@xxxxxxxxxx
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>