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

2018-05-03 Thread Wei Liu
On Thu, May 03, 2018 at 06:40:30AM +0200, Juergen Gross wrote: > On 03/05/18 01:45, Marek Marczykowski wrote: > > On Wed, May 02, 2018 at 01:20:09AM -0600, Jan Beulich wrote: > > On 30.04.18 at 23:54, wrote: > >>> Using RING_GET_RESPONSE() on a shared ring is

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

2018-05-02 Thread Juergen Gross
On 03/05/18 01:45, Marek Marczykowski wrote: > On Wed, May 02, 2018 at 01:20:09AM -0600, Jan Beulich wrote: > On 30.04.18 at 23:54, wrote: >>> Using RING_GET_RESPONSE() on a shared ring is easy to use incorrectly >>> (i.e., by not considering that the other

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

2018-05-02 Thread Marek Marczykowski
On Wed, May 02, 2018 at 01:20:09AM -0600, Jan Beulich wrote: > >>> On 30.04.18 at 23:54, 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

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

2018-05-02 Thread Oleksandr Andrushchenko
On 05/02/2018 10:19 AM, Jan Beulich wrote: On 02.05.18 at 07:29, wrote: On 05/01/2018 12:54 AM, 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

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

2018-05-02 Thread Jan Beulich
>>> On 30.04.18 at 23:54, 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

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

2018-05-02 Thread Jan Beulich
>>> On 02.05.18 at 07:29, wrote: > On 05/01/2018 12:54 AM, 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

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

2018-05-01 Thread Oleksandr Andrushchenko
On 05/01/2018 12:54 AM, 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 taking a

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

2018-05-01 Thread Wei Liu
On Mon, Apr 30, 2018 at 11:54:36PM +0200, 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 >

[Xen-devel] [PATCH] 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