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] RFC: 32 bits as smallest atomic size.

>>>>> "KF" == Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> writes:

 KF> I expect we can fix that up in the ppc macros: if the atomic access is 
 KF> sub-32-bit aligned then round the address down to 32-bit boundary and 
 KF> do a 32-bit cmpxchg.

A few issues:
  1) this assumes that the quantity is wholy contained in our atomic
     unit, by using packed there is no way to guarantee that.

  2) it would have to be a runtime decision on all PPC atomic
     operations that could fail with no real failure path available.

We could also program it out, consider this alternative:
    typedef struct {
        struct {
            u16     flags;      /* 0 */
            domid_t domid;      /* 2 */
        } atomic;
        u32     frame;      /* 4 */
    } grant_entry_t; /* 8 bytes */

Few things to note:
  1) packed is necessary since the ABI will do the right thing
  2) would simplify the code at grant_table.c:162
  3) will have better performance since all access are guranteed to be

I understand the usefulness of packed, but its gratuitous use
unecessarily complicates other architectures, and can hurt even x86 if
it results in a data that "straddles" cachelines.


SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
Xen-devel mailing list