Re: [Xen-devel] [PATCH 1/6] xen: Add RING_COPY_RESPONSE()

2018-04-30 Thread Boris Ostrovsky
On 04/30/2018 05:27 PM, Marek Marczykowski-Górecki wrote: > On Mon, Apr 30, 2018 at 05:25:52PM -0400, Boris Ostrovsky wrote: >> Also, perhaps the two can be collapsed together, along the lines of >> >> #define RING_COPY_(action, _r, _idx, _msg) do {  \ >>     /* Use vola

Re: [Xen-devel] [PATCH 1/6] xen: Add RING_COPY_RESPONSE()

2018-04-30 Thread Marek Marczykowski-Górecki
On Mon, Apr 30, 2018 at 05:25:52PM -0400, Boris Ostrovsky wrote: > Also, perhaps the two can be collapsed together, along the lines of > > #define RING_COPY_(action, _r, _idx, _msg) do {  \ >     /* Use volatile to force the copy into _msg. */ \ >   

Re: [Xen-devel] [PATCH 1/6] xen: Add RING_COPY_RESPONSE()

2018-04-30 Thread Boris Ostrovsky
On 04/30/2018 05:01 PM, Marek Marczykowski-Górecki wrote: > Using RING_GET_RESPONSE() on a shared ring is easy to use incorrectly > (i.e., by not considering that the other end may alter the data in the > shared ring while it is being inspected). Safe usage of a response > generally requires takin

[Xen-devel] [PATCH 1/6] xen: Add RING_COPY_RESPONSE()

2018-04-30 Thread Marek Marczykowski-Górecki
Using RING_GET_RESPONSE() on a shared ring is easy to use incorrectly (i.e., by not considering that the other end may alter the data in the shared ring while it is being inspected). Safe usage of a response generally requires taking a local copy. Provide a RING_COPY_RESPONSE() macro to use inste