ml_interface_{read,write}() would miscalculate the quantity of
data/space in the ring if it crossed the ring boundary, and incorrectly
return a short read/write.
This causes a protocol stall, as either side of the ring ends up waiting
for what they believe to be the other side needing to take the
Andrew Cooper, le Wed 28 Oct 2015 16:05:36 +, a écrit :
> @@ -62,22 +62,32 @@ CAMLprim value ml_interface_read(value ml_interface,
>
> xen_mb();
>
> - if ((prod - cons) > XENSTORE_RING_SIZE)
> + if (((prod - cons) > XENSTORE_RING_SIZE) ||
> +((cons - prod) < -XENST
On 28/10/15 16:18, Samuel Thibault wrote:
> Andrew Cooper, le Wed 28 Oct 2015 16:05:36 +, a écrit :
>> @@ -62,22 +62,32 @@ CAMLprim value ml_interface_read(value ml_interface,
>>
>> xen_mb();
>>
>> -if ((prod - cons) > XENSTORE_RING_SIZE)
>> +if (((prod - cons) > XENSTORE_RING_
Andrew Cooper, le Wed 28 Oct 2015 16:43:54 +, a écrit :
> > IIRC the test is not bogus even when prod wraps around, (prod - cons)
> > will still correctly be the difference between both, modulo 2^32.
>
> (prod - cons) >= XENSTORE_RING_SIZE checks for the prod getting more
> than a ring's worth
On 28/10/15 16:56, Samuel Thibault wrote:
> Andrew Cooper, le Wed 28 Oct 2015 16:43:54 +, a écrit :
>>> IIRC the test is not bogus even when prod wraps around, (prod - cons)
>>> will still correctly be the difference between both, modulo 2^32.
>> (prod - cons) >= XENSTORE_RING_SIZE checks for t