From: Jimi X. <ji...@wa...> - 2005-03-25 23:49:32
|
>>>>> "KF" == Keir Fraser <Kei...@cl...> 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 aligned. 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. -JX |