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

Re: [Xen-devel] [PATCH v6 02/18] Add cmpxchg16b support for x86-64




> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: Tuesday, September 08, 2015 5:19 PM
> To: Wu, Feng
> Cc: Andrew Cooper; xen-devel@xxxxxxxxxxxxx; Keir Fraser
> Subject: RE: [PATCH v6 02/18] Add cmpxchg16b support for x86-64
> 
> >>> On 08.09.15 at 10:57, <feng.wu@xxxxxxxxx> wrote:
> 
> >
> >> -----Original Message-----
> >> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> >> Sent: Tuesday, September 08, 2015 4:52 PM
> >> To: Wu, Feng
> >> Cc: Andrew Cooper; xen-devel@xxxxxxxxxxxxx; Keir Fraser
> >> Subject: RE: [PATCH v6 02/18] Add cmpxchg16b support for x86-64
> >>
> >> >>> On 08.09.15 at 09:37, <feng.wu@xxxxxxxxx> wrote:
> >> > Thanks for your suggestion. How about this?
> >> >
> >> > #define cmpxchg16b(ptr,o,n)
> >> \
> >> >     ( ({ ASSERT(((unsigned long)ptr & 0xF) == 0); }),
> \
> >> >       BUILD_BUG_ON(sizeof(*o) != sizeof(__uint128_t)),
> >> \
> >> >       BUILD_BUG_ON(sizeof(*n) != sizeof(__uint128_t)),
> >> \
> >> >       __cmpxchg16b((ptr), (__uint128_t *)(o), (__uint128_t *)(n)) )
> >>
> >> Yes (properly parenthesized and the ({ }) either removed or extended
> >
> > We need the ({ }) for the ASSERT statement, or we will meet build error.
> 
> And note that I didn't unconditionally say drop it, I provided the
> alternative of making it cover the entire expression (at once allowing
> you to convert the comma expressions to more conventional individual
> statements).
> 

This is not a big issue, If you don't like the above solution, please be 
explicit,
just type it, in code, save efforts for both of us. Thanks!

Thanks,
Feng

> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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